There certainly is a positive correlation between what people like and what is good for them, for obvious evolutionary reasons, as well as meta-evolutionary ones (we evolved the ability to learn to like previously rewarding experiences). But it's weak evidence and stronger evidence specific to the kind of behavior being discussed will overrule it very easily.
In the example of food, it's known that many foods exist today which people like but are bad for them. People have to deliberately keep to unpleasant, healthy diets. Even though there is disagreement over which diets are better, there is no disagreement that the diets formed by just eating whatever we like are harmful (ETA:) for many people. The evolutionary optimizations are clearly not working for them. And the different dietary theories explicitly address this: they will say that modern food availability is different from the ancestral environment in certain ways which cause this harmful behavior.
Absent such specific knowledge, it would seem that the prior should indeed be that we instinctively like what is good for us and dislike what is bad for us. But in most practical cases it's easy to imagine that the behavior or stimulus in question didn't exist in the same form in the EEA.
Suppose I am hungry in the jungle, and I encounter an unfamiliar kind of fruit tree. Its fruits are green and fuzzy like tennis balls. I feel a desire to bite one. When I taste it I enjoy the taste. Does that mean it's good to eat? Or does it mean it reminds me of some irrelevant, artificial modern food's taste and also of the fact I love to play tennis? I have no idea, and my caution of new unfamiliar food would win out because I don't trust my evolutionary instincts enough.
Perhaps this heuristic of doing what I like works best in specific sub-fields where it is known to work well. For instance, social relations for some people (like me) are pretty opaque: I'm at a party, should I laugh now, can I start talking to this person, am I dressed right? I can get along fairly well by just doing what feels good, which is presumably a whole lot of complex behavioral adaptation working correctly.
I have no idea, and my caution of new unfamiliar food would win out because I don't trust my evolutionary instincts enough.
Perhaps your caution of new unfamiliar food is itself an evolutionary instinct? Rats exhibit such caution, and they haven't learnt any dietary theories. Faced with new, unfamiliar food, they will try just a little bit. If it causes any sickness, they'll avoid it thereafter. This makes them difficult to poison, since most poisons will make the animal sick if the dose isn't enough to kill.
I posted recently that "I tend to assume that things people hate are bad for them. CR may be an exception, but it's plausible that evolution would usually select for warnings that one is hurting oneself."
I think this points at an interesting question. If you know that people like a behavior, or dislike it, or love it, or hate it, does this tell you anything about whether the behavior is useful?
I expect that most people reading this question have a handy list-- one that comes quickly to mind-- of things which are good for people but that they resist. There's a tremendous amount in the culture (and perhaps more from somewhat different angles at LW) about people's reflexive preferences being wrong.
However, there's a lot where people's preferences are assumed to be in line with what's good for them that doesn't get much attention. I believe this is because there's a fascination with the drama of self-denial, but that might be a topic for a different post.
For example, people hate long commutes. I've never heard anyone say that long commutes are good for people.
People generally dislike being low on sleep.
Rather few modern people think that liking sex is a problem in itself. (Note a cultural shift-- anxiety about pleasure has been moved from sex to food.)
Nobody says that human contact is bad, even though many people like it.
And there's no cultural consensus that hating spam is bad, even though hating spam is a spontaneous response.
It's implausible that evolutionarily developed pleasure and pain should be completely out of line with well-being. On the other hand, it's a noisy signal. Should it be taken at all seriously?