Why couldn’t they be invalidated? When laws were passed forbidding polygamy, the redundant marriages were anulled, but society didn’t collapse.
To invalidate or annul a marriage, in most states, there must be fraud, fraud in which one party of the marriage was deceived, not qualified or incapacitated at the time of the marriage procedure.
In same sex marriages that have taken place, unless one of the above standards is met, there are no grounds to invalidate the marriage.
Additionally,
The Constitution does not allow states to pass ex post facto laws.
And again, the Court would be drawn into questions about the Equal Protection Clause as various classes of people would be established.