That's selection bias at work. It's extremely hard for a woman to land a job in this field
I completely disagree. I have worked at many tech companies over a thirty year career, and my experience has been the exact opposite. Many companies bend over backwards to hire more women programmers and engineers. I have heard many male engineers say that they would prefer a more gender balanced workplace, and have never heard any say they wouldn't like that. When I have hired women, the male engineers have always treated them with decency and professional respect.
On the other hand, I have never had any problem hiring saleswomen, or even female forklift drivers. The shipping crew at my last employer was 60% female, despite the crude sexism of their male coworkers that complained about too many "bitches" in the warehouse.
I think the dearth of female programmers is simply that women are not attracted to a career that involves sitting in a cubicle interacting with a computer. Women have broken into many male dominated professions. A majority of new lawyers are women. Nearly half of medical students are women. Unlike programming, those careers are perceived to have a lot of human interaction.