Most of the developers I know play video games. This is relevant for a couple reasons. Gaming (especially PC gaming) means that you're more likely to be tech-savvy because you might wonder why a game is running so slowly on your family PC, and then read cool stuff about why your CPU sucks or something. Video games also can be a "gateway" into tinkering with programming by writing bots or writing your own games. Playing the same game as one of your peers means that you have a common interest, and are more likely to be friends. The more friends you have that are also developers, the more likely you are to feel like you "belong" and that you are in the right field.
Now, read this article on how the stereotype that video games are for boys was developed: http://www.polygon.com/features/2013/12/2/5143856/no-girls-a...
It's pretty long, but the tl;dr is: Once upon a time, video games (like pong) were designed for the whole family to play. The video game industry bubble popped because people have short attention spans. To try to figure out how to survive, companies like nintendo did a lot of market research and found that more boys were playing video games than girls. It is easier for the marketing team to direct their resources to a specific demographic of people. Since there are more boys than girls who play video games, nintendo starts running marketing campaigns to explicitly target boys in the early 90's. Nintendo starts launching products that are literally named the gameboy.
The article doesn't really go into this at all, but kids started experiencing heavily genderized video game marketing in the early 90's, and by the time they choose to major and graduate from college, that roughly maps to the sharp decrease in women in CS starting in the early 2000's. This obviously isn't the only factor, and also possibly doesn't even account for half of it, but I definitely think it's a significant factor that nobody really talks about.