A tomato is essentially an ovary with its seeds, as quoted by wiki!
To go in detail, once a seed develops, it keeps some layers of food around itself as nutrition!
Two of the most common types of these layers are of course, nuts as we know them and berries! Berries have an edible pericarp with division of endo/meso/exo-carp! Second is nut has a dried up pericarp! Any thing else is a false fruit (eg: Apple, strawberry). Since tomato has an edible pericarp, its a FRUIT.
Info source:Biology Major now in Med School!😛