A gigantic survey (I could find references if you are interested) has shown that from ultra-repressive environments (Muslim or African countries) to ultra-liberal countries (Northern Europe) the percentage of women going into CS is about the same. It actually decreases a bit in progressive countries.
This strongly supports the fact that the environment does not matter, biological differences do.
A similarly plausible argument is that despite a lack of overtly regressive policies towards women in the West, there are still a number of cultural norms that influence their behaviour. Which is exactly the point the parent comment is making.
Also area's like India,when men and women are under more economic pressure, there is more gender equal distribution in fields.
I've had this explained to me as the "Nordic Paradox".
If women in Sweden are doing the same career choices as in Saudi Arabia, as a matter of fact one can rule out the society as a factor.
Unless you want to believe that Saudi Arabia and Sweden are equally oppressive to women.
It clearly must be something biological.
Now that I have kids, I realize how early the push for conformation to some societal ideals starts. 3-4 yr old kids in day care already have this notion of how girls are not supposed to play with boys, they should look pretty all the time, they should not play rough with each other or other boys. Girls in 1st grade paying more attention to how their hair looks than how good they are reading/writing. I remember that many of my girlfriend's families passively discouraged them from going into male dominated majors, saying it would be easier for them in the long run.
Once, in a line at gamestop, I saw an altercation between a pre-teen girl and a pre-teen boy. The pre-teen boy was adamant that the girl should not be allowed to purchase a game he thought was meant just for boys. Neither of them knew each other. The girl's father interjected and made it clear to the boy that she can choose to play whatever game she wanted and it was not his job to keep her out of it. This is not abnormal in gaming world, grown men even today scorn on female gamers.
IMO, the best way to combat this problem is to have parents actively push their daughters into tech education from early years. Dads spending time with their daughters and giving them confidence that they can be as good as boys will work wonders. And I say Dad specifically because when the most important man in a girl's life shows her that she is as capable and can compete against other boys who will eventually become men, she cares less about fitting societal norms.