I guess for me, I always thought that because Starfleet had been in contact with alien races for well over a century starting with TOS, that meant that it was known what agreed with our systems and what didn't, and obviously you don't eat what doesn't. If there's some kind of pill or potion that can be taken so that food can be eaten universally, then why did the tactical officer have to take something specific just so he could eat pineapple? I guess my thing is, in order to have a pill or injection that makes all foods alright, you'd have to know about those foods to create that pill or injection, right? Since this is the first mission/voyage, how could that have happened? I don't think the Vulcans gave them such a pill or what have you because they've already come across people that the Vulcans never met (like in this episode?). Even the TOS people were (also) charting unknown territory, and I don't think they ate the food from every planet they came across that had inviting races, but I haven't seen the whole of that series so I could be wrong.
I dunno, I just thought it was weird. I guess it comes down to what
Skywalker said: Sci fi is funny sometimes.
EDIT: And not to keep thinking about it, but they could at least scan the food with their tricorders (or whatever they are in this era) to see if it would be agreeable. That would make sense.