And the problem is that women often don't know they can enter these fields.
There are tons of women who want to enter trades. However, all they see are men everywhere - and thus society has set up a stigma that "girls can't code" or "girls can't be electricians".
The assumption is "girls aren't interested" is about as true as saying "boys don't cry". It's a sexism thing - girls play with Barbie, boys play with GI Joe. Heaven forbid you have a boy who's interested in Barbie, or a girl who wants Transformers.
In fact, many trades have "girls do trades" type events where the whole purpose is to show that yes, if you want to sling a hammer, or do electrical work, or plumbing, or whatever, you can. Often there's no role model to say "yes, you can!" in a family context, so plenty of people make the assumption that no, you might like to work on the computer and have a great time at it, but only boys code, so go and be a nurse instead".
I'm sure there's probably a huge dichotomy of people who are in unhappy careers because it "fit the stereotype" rather than actually exploring options in what they are more interested in. I know people who did computer science in university because they didn't know what to do, so their parents said to do computer science as it was popular. I'm sure you all know how that usually turns out
And the reason I think it's cultural? Other cultures have often no such qualms. I've seen lots of women from Indian, Chinese, or Eastern European backgrounds. They were encouraged to do the sciences and they pursued them Also, take a look at advertising for video games prior to the videogame crash - you'll find it's often done as a family activity with both a son and a daughter enjoying what little game there is. But afterwards, it's purely something the boys do. And it has something to do with Nintendo - because in order to sell the NES, Nintendo couldn't market it as a "video game" as that was poison. So they marketed it as a toy (aided by Robby). But if you do that, you need to pick - does it go in the boys section or the girls - heaven forbid a toy might actually be interesting to both sexes.