When states pass obviously unconstitutional laws that will disintegrate in (costly) court there should be some federal office of oversight monitoring these things with teeth like loss of federal funding disincentivizing such bullshit.
The failure mode is no worse than what you have right now. It's just a lack of enforcement and the state does this fuckery until it ends up challenged in court, no?