Congress did not pass the law. States can do as they want. States get the leaders they elect.
It’s my understanding that the First Amendment (among others) has been “incorporated”, meaning it applies to state governments as well as the federal government.