1) It was way before it became prestigious.
And
2) An explanation of this needs to account for a great and rapid shift in favor of women, as far as proportion-of-practitioners, that was happening at exactly the same time as the opposite shift in programming, in both law and medicine.
I don’t know what the actual reason is but “it got prestigious so women got pushed out” makes no sense to me, based on the timeline of events in full context. It was very much not prestigious in the ‘80s and early ‘90s, certainly far less so than law and medicine at that time (still isn’t as prestigious as those, outside tech circles—you can see it in people’s faces. It’s high-paid but lower-“class” than those, to this day)