They might have been legal, but that was the choice of the individual state, city or county, not the federal government. "the powers not delegated to the United States by the Constitution, nor prohibited by it to the states, are reserved to the States respectively, or to the people"
that was supposed to have been “they might have been illegal”, not legal...