Because that was that power of one of its eyestalks in previous editions of the game.
In AD&D book Monster Manual II (1983) by Gary Gygax, the ability to create food and water is one of the spectator's four eyestalks, the others being cause serious wounds, paralyzation ray, and telepathy.
The special quality of "Undead Traits" didn't really exist until D&D 3e (2000), which took design influence from Magic: the Gathering to apply general traits to specific monster types. The fact that undead don't need to eat or sleep wasn't really considered relevant by the designers of the very early editions of the game, when D&D was largely about fighting monsters in dungeons rather than any kind of realism.
In the D&D third edition book Magic of Faerûn (2001), the spectator similarly has the ability to create food and water with one of its eyestalks. Its other three were inflict serious wounds, hold monster, and suggestion. An updated version of the creature in Lords of Madness (2005) changes the creature so it creates food and drink as an innate ability, and one of its eye stalks instead causes fatigue.
It needs to eat and drink because according to its lore, the spectator is dedicated to to guard a specific place or thing without the luxury of leaving to hunt for food. Beholders are traditionally a type of living creature known as an Aberration, and therefore it would not be correct to simply make them Undead. Aberrations frequently have to eat, and the large mouth of beholder-like creatures strongly suggests that it is a creature which must eat to survive, and perhaps even greatly enjoys eating. It's therefore highly thematically appropriate for the spectator to be able to create food.
Giving creatures the ability to cast a single spell is a long-standing D&D mechanical tradition that dates back to the earliest editions of the game, when the easiest way for designers to give a monster a magical capability was simply to allow it to cast a spell normally available to a player character spellcasting class such as the cleric. D&D third edition often did this, where they were generally known as spell-like abilities.
It's not unthinkable for living creatures to be immune to the need to eat and drink, of course. The elan are a race of people who are of Aberration type, and they can sustain themselves without food or drink.
Best Answer
The spell does not say, so it is up to your DM
There is no indication in the spell what the food consists of. As such, you must talk with your DM and decide if it makes sense for the spell to allow for the creation of bland but nourishing meat.
As Jeremy Crawford has said:
In my opinion there is nothing game-breaking about allowing a food-creating spell to create some sort of meat. It is, after all, the purpose of the spell to create things to eat. In other words, I see no reason that would justify restricting player freedom and choice in this case.
"Nourishing" food could even make meat vs not-meat irrelevant
In fact, I think it is even reasonable to read nourishing ("containing substances necessary for growth, health, and good condition") as indicating that it doesn't even matter. If the food is nourishing for anybody that eats it, then even a carnivore would be able to subsist on it no matter what form it takes. (If a carnivore can eat something and find it nourishing isn't it essentially meat?) As a DM, this means that I would see nothing wrong with allowing the player to theme the food/water however they like.
However your DM may disagree. Talk with them and work it out.