I think a large part of this comes from the way men attempt to monopolize prestige. This takes a variety of forms, from disparaging women dominated activities as "women's work" to forceably creating harassing environments in prestigious areas.
Just to take a brief history from my industry, software, the first programmer a woman, the first "computers" were women, and women did much of the important programming work at NASA and other places:
IIRC there were even sexist rationales at the time for why programming was naturally "women's work;" it was simply operating office machines much like typewriters, or perhaps sewing machines. Why would men want to do that when they could be doing "important" things?
In modern times, centering a "computer science" degree as an entry point to the industry instead of something more mundane like practical programming or software engineering, is an attempt to bestow the field with extra prestige and barriers to entry. Nonetheless the share of women pursuing degrees in computer science seemed to be approaching parity until hitting a wall in 1984:
What happened in 1984? One theory is that with the availability of cheap home computers, middle class families only bought these for boys and so by the time they reached university, women were playing catch-up. But I think at least as big of a factor was this:
If software was a field where someone could be praised for having a singular brilliance and greatness, and even be a gateway to becoming a billionaire, that's going to start drawing in the kind of guys -- almost always guys -- who see themselves as singularly deserving of that kind of high reward, and fighting other humans as pretenders to their throne.
And when someone supposedly possesses great, brilliant, irreplaceable intelligence, what is it if they are also sexist, harassers, "not people person"s; the victims they leave behind are supposedly nothing to what amazing insights these geniuses might achieve. I saw a quote from a Cosby lawyer recently, to the effect that (cw) fake rape accusations that damage a reputation are worse than rape itself! The very fact that the reputation of a man can be so important that damaging it is even worse than harming a real person is among the worst misfeatures of our culture. The idea of individual geniuses, "self-made men," and other heroisms are myths not yet excised.
As you can see from the chart above, in recent years with the supposed computer democratization of the internet, there are even fewer women entering the industry than ever before, possibly because the rewards -- and therefore the assholery -- are higher than ever. And women who break into the industry still are often stereotyped into less prestigious roles -- this is such a telling article -- roles that, in fact, weren't even coded as less prestigious until extremely recently.
The prestigious software roles are protected by an interview process that emphasizes minutia from four year degrees that's almost never used in the course of a job, the privilege to contribute free labor to open source projects or have tech related hobbies, having read the right books, and "culture fit." Even as they complain about a shortage of workers in the industry, few programmers are willing to admit the classist and anti-minority nature of that process. The sneakiest union is one that doesn't even see itself as such.
(If I sound mad about this, I am. I saw over the course of the past year a talented young woman, a friend who grew up in crushing poverty, repeatedly rejected from jobs that I know for a fact any mediocre white man would have landed. She finally got something, but at the cost of a 10 month gap in her employment and the variety of desperate things someone with her history has to do to survive.)
I think similar historical trends have occurred in fields like psychology, biology, etc. When these areas were seen as prestigious, having individuals with great thoughts and insights, they were male-dominated; when they began to be seen as primarily hard work rather than the domain of geniuses they shifted to being mostly women. All of this is part of the evil process of men monopolizing prestige.
I think one of the best responses to this is to continually question the concepts of individual, singular "greatness," "genius," and any similar attribute a person might achieve to make them seem irreplaceable. The giants after all, stand on our shoulders. Any individual is replaceable; an entire class of people, cannot be!
But as long as the greatness myth exists, I suppose we must also employ it to demonstrate the incredible genius of women, both in and out of male dominated industries.