It was for Cupid's Day. They were supposed to be love-hearts. You'd take the hat of someone else, and as a result, you and them would be a forced couple. Also, whoever retrieved Lelouch's hat, would get their club's budget increased tenfold. This, combined with the fact that Lelouch seems to be the best looking guy in school (and thus everyone wants his cock), meant that many people ended up abandoning all reason. Hence why Anya used a fucking Knightmare Frame to try and catch him.