If for the same amount and quality of work the law firms has to pay 40% more for men, shouldn't they hire women exclusively?
Discrimination exists, but markets are usually pretty good at squeezing it out and punishing it.
I read your post as pinning it on the selling-side, but I'm not sure thats true; it seems more reasonable to me that the market would naturally stamp out discrimination on the seller-side unless its being enforced by consumers; ie if the population in general distrusts women leading a firm, and thus gives them less business as a result, then their market value is actually lower, because they can't fairly compete. So the market is being efficient given the nature of the environment. It might be better off in a different environment.
See "The Strange Career of Jim Crow" by Woodward.