I believe that those type of state laws have been struck down before by federal courts. Its likely going to take a federal constitutional amendment to allow that.
.....yes, something like this law might get eventually shot down, but it’s a good warning shot aimed at the corrupt despicable Pierre Delecto.