> Did you have any specific alternatives you were thinking of?
There are several.
For example, it is known that gender bias in groups has a tendency to not only perpetuate itself, but to also reduce participation by the minority gender (even without any hostile action by the majority; it seemingly suffices often to simply feel like an outsider).
Second, the power of stereotypes is strong, even where they are wrong. For example, in Liechtenstein's 1968 referendum on women's suffrage, even nearly half the women wanted to deny themselves the vote [1]. A bad case of Stockholm Syndrome, perhaps, but indicative of how powerful established stereotypes can be. In the early 1980s, working with computers was still often considered to be something more like a secretarial job.
Third, computer science started to pay more and grant higher status, making it more attractive to men (especially in a society where men are still predominantly the breadwinners and women responsible for childcare [2]).
And that's just off the top of my head.
I have no idea what the actual causes are (I am fairly convinced that there are several of them, working in tandem). What I do know is that gender roles are shaped pretty much from birth, so I'm extremely skeptical of a theory that attributes this to preference alone (preference may well play a role, but it's so very difficult to tease out the difference between nature and nurture when it comes to these things).
[1] https://en.wikipedia.org/wiki/Liechtenstein_referendums,_196...
[2] Ironically, IT jobs are often more likely to allow for working from home, making it easier to reconcile a career with childcare.