I see one of the biggest reasons, and the reason that I left computer science was the arrogance and hostility of the professors. I went to a top 15 CS program and stayed in for a year and a half. There seemed to be a culture of who could make the class
the hardest among the faculty. Exams were amazingly difficult and grades seem to correlate very little with programming ability. I admit that after being told that I know nothing about coding, despite the fact that I worked as a developer through high school
and know how to ship software, by people who could not even write a project spec I threw in the towel. I still develop although now I do mostly design and oversee programmers overseas that do the actual development.

If you want more girls make it less of a dick swinging contest. This is the same reason that you don't find many girls working on the trading floors of wall street firms.

THE ARROGANCE OF CS FACULTY AND THE WAY THEY TREAT STUDENTS IS APPALLING.