Once upon a time (I can speak of the 1970s), computer programming was an unglamorous, low paying job. There were programming jobs at the time which just barely paid more than the US minimum legal wage. Many universities did not yet have computer science departments.
There were many more women computer programmers back then. My first was working for the local school department (while still in high school), 2 of the 5 programmers were women.
My second job was working for a then major software development firm doing hardcore realtime systems on minicomputers, 5 of the 8 programmers in our office were female. And, out of the several hundred programmers in the company, nearly half were women.
Women started disappearing from the field during the early 80s, at roughly the time programming became a well paying and popular career option. The new computer science departments were predominately populated by male professors and students, as was the emerging hacker culture that led to the development of the PC.