Sad to say, I've observed that people who are drawn to this profession tend to be less adept at interactions with humans in general, and moreso with humans unlike themselves.
It's got to be tough to not be a white male in my profession. It's a damn dirty shame too, because women in general make better programmers, most of the time - more careful, less cowboy. I see it all the time, and I try to knock it back when I can, but there's no doubt it's a huge problem.
A lot of men I work with are questioning their assumptions about women who code, and I am so happy to see that progress. But not everyone is there yet, and given their underrepresentation, I think the assumptions may be even worse for people who aren't white or straight. So, articles like these.
I'd imagine math should be attracting the same types of people, but there seems to be a much higher participation of women (at least from what I see at my university) than there is with computer science, and far less discouragement to others in the discipline (though I should note, only to people in the discipline). I think a lot of it really does have to do with a reinforced culture than just the standard social ineptitude. I also see some similar kinds of behavior among engineering disciplines, so perhaps that's where it started, but I don't want to jump to that conclusion instantly.