Because oil is a non polar compound and vinegar is a polar mixture....in this case you have the "like-like" situation where polar mixes with polar and non polar to non polar
Oil and vinegar do not mix for long. Like oil and water, the oil floats. Shaking it up can sort of mix them, but it separates quickly and stays separated until it is shaken.