Scott Adams has a theory:
If you wear the jersey of your favorite team, your brain associates the colors and the logo with the good feelings of watching a game. The rational part of your brain might tell you that you wear the team jersey because you look good in those colors, or you support the team. But I think the real reason is a simple association with the stimulation you feel when watching your team compete. It's an accidental subroutine.
More Intelligent Life traces the history of sport.
(Image: England flags adorn a house in a street in the Knowle West area on June 11, 2010 in Bristol , England. Although the 2010 FIFA World Cup is being hosted 1000s of miles away in South Africa the tournament is celebrated throughout the UK with many homes, business and cars now flying England flags and other football paraphernalia. By Matt Cardy/Getty Images)