1. Everyone gets cataracts if they live long enough--clouding of the lens in your eye. This lowers the contrast of the image reaching your brain. The brim of a baseball hat improves contrast by keeping stray light rays from boucing around in your lens, diminishing your vision.
2. The older you get, the more you want to not get sunburned (especially if any of your friends have gotten skin cancer). This is especially important if you hair is thinning or gone on top.
3. The head radiates warmth disproportionate to the rest of the body (except when you're exercising hard). So if your hands feel cold--put on a hat. Your body will sacrifice your hands to keep your head warm, for what should be obvious reasons.
4. They provide a handy way to advertise some personal interest. For me that doesn't include any pro sports, but it does include scuba diving (the white dive flag with a diagonal red stripe), wildlife conservation...stuff like that.
They like or love baseball.
They like of love their team.
They want to appear more casual and less like a suit.
They like wearing hats.