Food is usually uncountable but it can also be countable.
When talking about the general concept of food, it is uncountable.
e.g. "I ate a lot of food yesterday."
It is countable when talking about different, distinct 'types of' food.
e.g. "I ate many different foods when I visited India." [I ate many different types of food..]
or "Lots of the foods he eats are high in fat."
There are lots of nouns like this. When an uncountable is used as a countable noun, it is usually because you are talking about distinct examples, such as types/kinds of.
Coffee is uncountable, but we can say:
"I had two coffees this morning." - [I had two [cups of] coffee this morning.]