When you think about it, people's reasons for rooting for the underdog are actually very selfish.
When they find themselves in the "underdog" position, they want other people to cheer for them and rally to their cause too.
In most stories that champions underdogs, it's usually about villians ruling the situation, let's say a sport, for several years, and this year, this year...the underdog will change the status quo by winning.
In a way, you can also say that's in an unconscious wish by society to change the status quo and keep things dynamic.
The sad part about always rooting for the underdog is that sometimes it encourages a culture of mediocrity. Just look at popular reality TV shows like Survivor. It's not the best person who wins but the one who stays under the radar the longest...the person who is handy but is never perceived as a threat.
Another factor here is probably the religious upbringing of people which champions the martyrs and those who suffer silently. Catholics are quite prone to this. (I'm Catholic and this is my burden.)
Which in the end is still selfish because sometimes there is the question whether a person is allowing himself/herself to be an underdog so that s/he can have his/her pie in the sky, by and by.