I made a post about this topic one time. Scientifically, it is classified as a fruit, but it is considered a vegetable for tax purposes. Technically, a vegetable would be a plant part that we eat aside from the seed bearing parts such as broccoli (we eat the flowers and stems) or sweet potatoes (we eat the root).
Back in the 1800s, a bill was passed that made fruit imports exempt from tariffs. So, when a company tried to import a giant load of tomatoes (scientifically considered a fruit, so should be tax exempt) and were charged an import tariff, they sued and took the case to the US Supreme Court. The court ruled that tomatoes should NOT be considered fruit for tax purposes. Because, you know... money.
Their reasoning was that, even though the tomato is by definition a fruit, it has a savory flavor, so they justified calling it a vegetable, and that classification has been applied to other fruits that we call vegetables such as cucumbers and peppers.