It's one of the biggest areas of age discrimination out there -- unions negotiating tiny starting pay for new members so they can give continuous increases to older members. They give them the worst classrooms, too. Teacher pay overall is just fine.
As with anything in the bizarre municipal-county-state-federal labyrinth that constitutes the US public school system, things vary dramatically from place to place. One issue with many districts' pay tables is that they have too few steps, which is not good for "older members." As someone who was a public school teacher for six years, I also think many teachers would challenge your opinion that "teacher pay overall is just fine."
I'd like to see data on places where, as you imply, unions decide who gets the "worst classrooms" - when I was teaching in Chicago Public Schools, I heard that was once the case in a bygone era. Is this actually happening in 2021?