It's neither. It's a reason, an explanation.
> I think it's more complicated than "Women just entirely voluntarily choose something else."
From what I understand, the research shows that isn't the case. Basically all of the earning gap is explained by choices, not discrimination.
> Historically, teachers made relatively good pay and were respected. That was when it was a mostly male profession. That changed when it became a mostly female profession.
Correlation is not causation though. I know you know that, but just stating it for others that are reading this.
The alternative explanation can be this:
Societal expectations is that the resource provision is core to male value. This can be observed on the disproportionate impact of wealth on relationship attractiveness between the genders [1], men generally benefit more from status than women, and women tend to benefit more from attractiveness than men [2].-
With incentives like this, I find it unsurprising that men are more likely to chase status. It's also a cleaner model, with clearer causal lines than "society is built around paying women less".
Citation needed on this one, particularly on the "same work" section. It's my understanding that studies that followed up on the initial gender wage gap studies found that the intial gap shrinks drastically once the data was controlled for type of work (the same work assumption you made), as well as for the number of hours worked across a given time period.
Historically, teachers made relatively good pay and were respected. That was when it was a mostly male profession. That changed when it became a mostly female profession.
Conversely, programing was originally a more female dominated profession and not well paid nor respected. Now it is a male profession and very well paid.
Humans tend to pay men better for the same work. We come up with myriad explanations for the phenomenon but it's stubbornly persistent.
I think it's more complicated than "Women just entirely voluntarily choose something else."