Botanically, a tomato is a fruit—a berry, consisting of the ovary, together with its seeds, of a flowering plant.
However, the tomato is considered a "culinary vegetable" because it has a much lower sugar content than culinary fruits; it is typically served as part of a salad or main course of a meal, rather than as a dessert.
Tomatoes are not the only food source with this ambiguity; bell peppers, cucumbers, green beans, eggplants, avocados, and squashes of all kinds (such as zucchini and pumpkins) are all botanically fruit, yet cooked as vegetables.