It took med schools a few decades too, over which they first removed overt barriers (like "medicine isn't for women" attitudes among faculty), then successfully convinced more women to apply, and then finally accepted many of those applying women. CS's troubles are complex, but I think one of the stickiest ones is that interest/disinterest in studying CS seems to develop around high-school (same as studying math), so the imbalance somehow has to be addressed at the pre-university level. Med-school doesn't seem to have the same differentiate-by-age-15 aspect.
Given the importance of medicine to leading a happy life, it's important to get as much information out of patients as possible - so it's in the interest of the industry to make sure that the client-facing staff have plenty of both genders.
It's much less important in programming as users and programmers rarely interact. Was Firefox written mostly by men or by women? It doesn't matter to me as I don't interact with them in order to use the service Firefox offers.