I have no idea! All I know, is that it is very unfair for girls.
While everything about our bodies appears to have some purpose, we haven't always discovered what the purpose might be. There are three things known about underarm hair:
1) It helps to keep the skin under your arms from rubbing against each other. Skin rubbing against skin can be irritating.
2) We have very productive sweat glands under our arms, but the location would normally trap the sweat against the skin. This would prevent the cooling effect that sweat is suppose to produce. The hairs keep a slight separation under the arms, allowing some air flow, but they also wick the moisture away from the skin to where air can carry the moisture away, instead of just running down your sides all the time.
3) Some theorize, and have some small evidence, that sweat glands under our arms and on our groins produce pheromones (scents that are sexually arousing). Like the second answer, the hairs make sure the scents are carried into the air. On the down side, bacteria love these moist areas, so if the underarms and groins are not kept clean, the smell of unwashed bodies overpowers the light scent of pheromones and causes the opposite reaction: "Ewh! You stink!"