It is because women are smarter than men, and are making more informed career choices.
Back in the days of punched cards and computers the size of a whole data centre now, and memory that didn't got away when the power went off (yeah, I know, that one's come around again now), programming was a 9-5 family friendly (as much as any job was) day job. Programmers and operators were often women (my mother was one), if not mostly women - seriously, just do a google images search for "mainframe operator 1960s" (just for one example), those images reflect the number of women working with computers that you'll see in printed material from that era too.
Somewhere around the 80's - 90's with the personal computer revolution, and gaming, and continuing with the dotcom boom, programming turned into an aggressive deadline-driven first-to-market ship-it-yesterday career, with a long-hours work-till-it's-done culture that spread from startups out to entire parts of the industry (see gaming...). And the women stopped coming.
To pick a couple of other industries / careers I have some (UK based) knowledge of: in roughly the same time scale, in medical and veterinary, professionals went from being on-call all-hours (junior doctors infamously worked a standard 120hr week) to having out-of-hours contracted out and on-call hours counted into the limits under EU working time directive. Every programming job I've had has required me to opt out of the working time directive, but doctors don't. Now take a guess on two professional careers in the UK which are (or soon will be) majority female... medical (doctors) and veterinary. That is where all the smart women went, and if you want to know why just look at the culture changes in those professions and in programming.