I'm a female engineer, so I can say there is NO active discrimination against women in STEM fields.
There are several reasons why women are not as common in STEM as the life sciences or social sciences where they dominate. Interesting how no one screams sexism that men aren't half of nurses or lab workers.
1. While women's IQ is a narrow bell curve around average, men's is a flatter, broader curve. More idiots and more geniuses. End result - more men as a percentage are the uber-geniuses necessary to be math whizzes and physicists.
2. Men on average have better visual spacial skills for visualization that is necessary for Calculus 2&3 and engineering courses. Linear algebra, logistic matrices were much easier for me - so I shifted to industrial and manufacturing engineering.
3. Girls prefer on average dolls, cooking toys, playing house. Boys prefer to take things apart and learn how they work. I played with legos with my brother, but I also had barbies. I've given both my son and daughter Raspberry Pi. Those interests lead to learning that impact interest later on in tech fields.
4. When women are in the STEM fields, the workaholic culture often drives them away. I made as much as my husband, also an engineer, before I had children. When I couldn't work longer hours, my pay raises dropped from 5-8% to cost of living raises. When I had my second child and shifted to part time work, my career stalled. This is a reflection of a workplace that pushes overtime and grueling schedules on the high salaried workforce to offset for their high pay. We can talk about ending the expectation of 60 hour work weeks for engineers and programmers without calling it sexism, since I know that schedule burns out the men, too.
While I've spoken about averages, this doesn't preclude women having those interests or pursuing those fields. But screaming sexism to explain every gender based difference does preclude honest discussions about what works for different people and what can be done to help EVERYONE in the field.