It doesn't mean that all that have seeds are fruit, you know. Squash has seeds, and it's a vegetable.
Tomato is a fruit.
Actually, if you want to get technical, squash are also fruit. A fruit is, by definition, the ovary of an angiosperm, or more simply, the part of the plant that contains the seeds.