I think one additional factor in STEM is the grant money the stars bring in. If a professor of French or art history harasses his female students and they report it, it is easier to fire him because (a) there are many other French PhDs who would love to have a job and (b) it’s unlikely to cause the university a big financial loss.
It’s harder to find a replacement for a star chemistry or physics professor. More importantly, if he brings in a lot of $, firing him means losing that $. In some cases, firing a prof would mean the loss of millions of dollars. Plus, his graduate students would be really hurt by his departure.