A fruit is to its seeds what the egg white is to the yolk. When the fruit falls from the tree (or in this case the vine), it serves as "food" for the seeds to germinate. If you think of it this way, you will understand why tomatoes should be compared to apples rather than asparagus.
If you want to be fancy it's a berry, so it's a fruit, really. It is related to one very notable vegetable the potato. The solanaceae are numerous and the family includes the deadly nightshade, but don't let that put you off!