Alabama has a teacher’s union. It does not have laws against unionization as you say. More importantly, there’s a tenure process that makes it extremely difficult to fire bad teachers. Alabama has nothing like a private sector “at-will” status for public teachers. MA likely has lots of high IQ parents, who pass their high IQ genes down to their children, which accounts for the high test scores.
You say teachers will stop trying to teach, but are they trying to teach now? If so, we wouldn’t have the situation described by JHS where most high school grads lack “Basic reading, arithmetic, and communication skills”.