Most people who end up being programmers are nerds. Nerds who, in their teens, spent time playing with computers instead of partying with friends and crowning the high school social pyramid.
There are many more outright nerdy high school guys than there are girls, and the nerd boys are more likely to turn to computers.
What makes someone become a nerd? Probably a combination of social aptitude and physical attractiveness in the early teens. It doesn't help that girls reach puberty much earlier than boys do. Combined with the fact that girls are easier on the eyes than boys, and that they tend to be a little more socially adept, probably leads to there being more boys than girls who have difficulties in middle and high school, and end up falling back on computers.
Lastly, the nerd guys tend to occupy themselves with things more technical than girls, for the same reason boys play with transformers action figures, while girls play with barbie dolls.
--
PS: I'm no PhD in social studies, this is all conjecture and probably wrong.