Explaining phenotypic variance
You may want to make sure you have a good understanding of the concepts of the underlying variance of phenotypic variance (discussion linked to the concept of heritability) before reading this answer. In this post, I linked several sources of information on the subject.
Culture (environmental variance)
Variance in food preference is in part (in majority eventually) explained by cultural differences.
Genetic variance
I guess that very few people like the smell of rotten eggs. There is selection on taste and smell preferences. Those who don't like the smell of rotten food increase their chance to suffer from bacterial intoxication and mycotoxins. I remember from my Bachelor degree (can't find the study right now) Nestlé (among others probably) performed a genome-wide association study that showed genetic variance for food preferences.
Adaptation
There are probably many loci that are now fixed (not polymorphic anymore) that were at some point under selection as explaining variance for food preference. In other words, at a given locus there might have no more genetic variance as the current allele is well adapted.
By-products
Also I suppose that a part of the underlying genetic and environmental variance for the variance for food preference might be qualified as by-products. For example, it might be beneficial to appreciate a given smell because the smell when present in the sweat of a partner is associated with greater health. If this odour (or similar odour) happen to be present in food, then we may be indirectly selected to appreciate this food item as a by-product of the selection for recognizing healthy partners.