I was a CS/EE double major in undergrad. In the first two or three years, there were plenty of women who were engineering majors. By the time I was a senior, there were 2 or 3 left in my class. I don't know the reasons why they dropped out or switched to other majors, but from what I saw, I suspect they were put off by the constant one-upmanship and trying to make other people look stupid that goes on. Kind of like Slashdot. I think most of us (men) are guilty of it to to varying degrees.
Ok, maybe that's a way of being less interested. But they didn't start out less interested.
I vaguely remember a recent story about Google not wanting experienced developers in some entry level CS classes they were offering. The first thing that occurred to me was that the experienced people (likely men) might be disrupting the classes with the kind of thing I'm talking about.
In the past few years I've been taking biology and chemistry classes out of personal interest. There are more women than men in those classes. I hope I'm not being sexist, but it seems to me that women are both more bothered by that kind of behavior, and far less likely to do it themselves. In fact they're more likely to do the opposite: when someone is struggling with a concept, they try to encourage them, e.g. by saying "yeah, that was a tricky idea, I finally got it when I looked at it like this...", rather than saying "oh come on, it's simple, just look at it like this..."