Neither DEI nor misogyny have much to do with it. When people see how hard it is to actually land a real job in science or engineering, they change majors; or they graduate with their bachelors or masters and take a job doing something more available and just as lucrative.
I’ve got a civil engineer nephew-in-law who is now a Baptist minister. Had a cousin with a degree in pharmacy who became VP of a trucking company. I’ll bet you all know dozens of people like that.