I think the guaranty clause gives the federal government authority to prevent states from enacting this stupidity.
It might well, I confess I don’t know deeply about the ins-and-outs of it, but knowing how the Leftists work, I can see them finding a loophole like this. And I’ll bet it IS “constitutional” even if it is stupid and counterproductive!