My +45 years in IT (started in early mainframe days) confirms your observations. Some of my best bosses were women, and some of the smartest staff I managed were women. However, the gender ratio changed drastically over time. In the early days of programming, before there were formal computer science degree programs, applicants were hired based on aptitude and critical thinking tests, then trained internally in the then current technology. Women were a much higher portion of the workforce (near 40% in the 60's) and were often the brightest, most productive staff. As digital technology became mainstream, computer science and technology degree programs evolved, and kids were exposed to desktop computing at earlier and earlier ages, the applicant pool became mostly males.
Scott Alexander, a widely read psychiatrist blogger, has a post that cites a number of studies indicating that the absence of women in the tech field majors and their dominance in other fields (veterinarians, pediatricians, social workers, etc.) is based on interests and preferences that likely have biological underpinnings. To attract more women to the tech field, I think careers in tech need to be re-framed and tech education/training programs need to be changed to accommodate a wider range of interests.
(BTW, in the days of hiring applicants without tech backgrounds based on tested problem solving aptitude, liberal arts majors, English, History, etc. often became the most productive programmers and problem solvers. Music majors were the best. Math majors were often just OK).