There are likely many reasons as to why there are fewer women in STEM fields than men. Culture and socio-economics are two very big factors being completely dismissed here.
Chalking everything up to discrimination is intellectually lazy (unless there's good data presented and indicating that to be fact), and does nothing to help the situation. If you don't fully understand the root cause, how can you resolve the problem?
We should, of course, attempt to address and improve on all of the possible explanations except the last. If it isn't the last and we make the mistake of assuming that one, then there is harm in that assumption. If the last does contribute, then there is little harm finding that out after making an honest attempt to improve things. Because there are bound to be multiple contributing causes, and you'll at least make the situation better.