Because a tomato is female. Also היא serves as a present simple "to be" - it's the "is"
Actually, the following works and sounds like some newspaper headline:
עגבניה - פרי או ירק?
But that is really short for "עגבניה, האם היא פרי או ירק". If you want to say that something is something else, like a tomato is a fruit or a watermelon is green, you should have the "to be" stand-in: הוא, היא, הם או הן.
Two nouns one after the other as in "עגבניה פרי" is weird and meaningless, and sticking an adjective after a noun as in "אבטיח ירוק", makes the adjective describe the noun (a green watermelon) and then this is just a noun. It can be a subject or an object, but it's not a complete sentence.
I wrote פּריי because the audio sounded like pree-ee. How can you tell the difference between פּריי and פּרי ?
There aren't really short and long /ee/ in Hebrew. The speaker here says /pree/.
(There are two Hebrew words spelled פריי, both pronounced /piryee/. The first is the formal way to say "my fruit". The second means "fruity", as a wine or a perfume might be. Sadly, people would more often use פירותי for this sense.)
What is sad about the word פֵרוֹתִי? In אֶ֫בֶן־שׁוֹשָׁן it is described as הַמַּזְכִּיר פֵּרוֹת, שֶׁיֵּשׁ בּוֹ נִחוֹחַ שֶׁל פֵּרוֹת and the sentence לַיַּ֫יִן … גּוּף קַל וּפֵרוֹתִי the wine has a light and fruity body is given. It sounds exactly like the lofty descriptions in the Italian language I always read on wine bottles and can never understand...
Garden is saddened by people using the over-complicated word פירותי when פריי is shorter and more correct.
The word פירותי included a plural that you don't typically need in adjectives