Because the common-word definition of a berry is different from the scientific definition. This awkward science lady can explain it somewhat better: https://www.youtube.com/watch?v=-Z0bAxSNWY8
It's basically their anatomy. If they have seeds in them, they are berries. Fruits with a kernel like peaches are drupes. Multiple drupes fused together are polydrupes like a raspberry.
Then there are weird stuff like apples and strawberries whose flesh is not part of the fruit because it doesn't come from the plant's ovary.
Scientific vs culinary definitions.
Science also says toy breeds are dogs but I have my doubts.
There are several kinds of tomatoes that fit perfectly in a fruit salad because of their sweetness, and yes, it's true, tomatoes are berry fruits.