I think all y’all are over-thinking it.
When anyone is out of YHWH’s order, it should be considered a reproach (shame) to them. (The enemy has done a number on the elimination of shame, it doesn’t seem to exist anymore, choose your own gender, sexual orientation, god that you worship, it is not supposed to matter anymore.)
His order is that women be with a righteous man. Period.
They realize their haughty attitude and choose to change their circumstances. There aren’t that many righteous men, so they choose to share one.
Read the passage in its context, it details a narcissistic society morphing into one that is righteous and beautiful, and recognizing that some things are actually shameful seems to be the turning point.