Yes but they did not have the right to collectively bargain.
Even California outlawed Public Unions as until Jerry Brown became Governor.
I am not a big supporter of unions. To the contrary. But I can’t blame teachers (and their unions) for failing to teach reading and math to slugs who are sound asleep in class - when they even show up for class.