Luckily, he was on the side of the good guys. All he wanted to do was help fight the Persians to restore honor to his outcast father. But in a move that was epic both in douchebaggery and short-sightedness, Leonidas turned him away, spouting some bullshit about how the hunchback would weaken the strict formation of the phalanx.
Look, we're no experts on military tactics or anything but it seems to us like you could just place the dude slightly outside the phalanx, have him kill a few Persians, soak up a lot of arrows, and die a hero's death. Everybody's happy.
Hell, it's not like the Spartans actually fought in a neat formation anyway. A few seconds into the battle it turns into a free-for-all where everybody starts leaping around and trying to figure out how to kill each enemy in a cooler way than the last.
Instead Leonidas tells him that he's too weak to fight and that his father will remain dishonored, which in Spartan terms would be like if someone called you at a funeral and questioned your parentage while simultaneously making sweet love to your mother. The double-whammy of an insult drove the hunchback directly to Xerxes, where he immediately sold out the good guys.