Based on the handful of women I know who can program, there seems to be a few reasons why not many go into CS:
1) It seems they aren't exposed to it as much. They're less likely to read about it on the internet. Or learn about it from relatives. Or take classes in it.
2) The handful that I know who took programming in high school never (or barely) turned it into a hobby, even if they later declared CS as their major.
Meanwhile, I know tons of guys who got into programming by themselves, or because their parents did it. Also, all of the CS guys I know who took programming classes in high school did some outside of class for fun.
So, when some women become CS majors, they get intimidated. They see "everyone" outperforming them, since everyone is mostly guys with a pre-built set of skills. Even guys who are so-so at something quite frequently talk like they know stuff; that's just the way guys behave. This worsens the above impression. There's an actual culture difference. Can't stress the importance of this enough.
As a result, instead of thinking "These guys have years on me and I need to catch up and put lots of work in," many women think "I suck at this," and quit. Then next set has the same problem.
Meanwhile, I know tons of guys who got into programming by themselves, or because their parents did it. Also, all of the CS guys I know who took programming classes in high school did some outside of class for fun.
So, when some women become CS majors, they get intimidated. They see "everyone" outperforming them, since everyone is mostly guys with a pre-built set of skills. Even guys who are so-so at something quite frequently talk like they know stuff; that's just the way guys behave. This worsens the above impression. There's an actual culture difference. Can't stress the importance of this enough.
As a result, instead of thinking "These guys have years on me and I need to catch up and put lots of work in," many women think "I suck at this," and quit. Then next set has the same problem.
EDIT: removed a bit of unintentional italicizing