For pride, identification, and voice. Although logically it is silly, it is just as similar to wearing work uniforms, school colors, or hair style as a way of standing out and being recognized. It is a way of labeling our support and voicing our stand.
If you did a 5k run for support for breast cancer you would wear a pink ribbon. If you have family members that are in the military or are veterans, you would wear a yellow ribbon. If you are proud of your country, you would wear your flag and its colors. If I am an advocate for my universities I would wear school colors to show my pride and association with the school. If I placed a superman sticker on my car, you would be able to see immediately that whoever owns this car probably likes superheroes and especially superman. If I child goes to school dressed up as a fireman, they probably idolize them. If I wear a cross, peace sign, star of David, hijab, or other religious/cultural symbolism it means something to me and others who see me as someone who identifies with a group.
It is not necessarily rioting or hatred towards another group (although some use their rights to do disrespectfully go the latter), it is simply being an individual and showing that you have a mind of your own, make your own decisions, and do not have to follow the crowd no matter how popular or unpopular it is. It is a way of finding yourself and to voiceless speak about who you are. Same reason why people get tattoos? Purchase tourist clothing? Wear their favorite brand of clothes? Get memberships and gift cards at their favorite restaurant?
There is a psychological term for this social grouping but it fails to be remembered at this moment.
A very good question, Pyali. And a very good answer, because I like cynical answers, Barbara!
In case some people might not think this also applies to them, why do so many people think anyone cares what sports teams they favor?
Now, I think it's different when, say, a school sports team member wears some insignia to identify himself or herself as such. Yes, that would be a matter of personal pride (perhaps some might find that distasteful?). However, your favorite football team? Who cares, people. Let's face it. These teams are made up of well-paid mercenaries. If you knew them individually, you might very well prefer the members of a rival team!!
I actually don't watch sports, never really go to games, and could care less about who won or who lost. However, if I heard that my University one a game or they had some big accomplishment, I would cheer them on and congratulate them. I would still be associated with them and advocate students to go to the school even if they lost (which is a lot). Although I don't know the players and rarely do meet them, I appreciate what they do but that is not why I chose the school. Sometimes people choose teams based on small appreciations or culture. For example, in the olympics, i could cheer for the U.S. but that doesn't mean I won't associate the Russians or Chinese as some of the best gymnasts I have ever seen. If I went to their country, my pride for them would be based on accomplishment and "status" even though I am not one of them.