Same deal with unions in tech. Say you're in favor of immigration for high skilled workers. Most unions are against immigration when it has the potential to increase the supply of labor in their field (because increased supply = lower costs of labor).
I think that's a good point -- unions are not perfect and may support the interests of their members over the interests of other workers or society at large. However, in my view they are far preferable to any corporate board of directors, which represents only the interests of the owners of the company. Politics is struggle, it isn't just opting out of things you don't like, or else you'll end up a hermit. it's organizing for representation and power, and unions are one example of that kind of organization. An imperfect one, yes, but far preferable in my view to none at all
There are certainly unions with bad politics. The ideal is a union that is embedded as part of a broader pro-worker movement that supports migrants, women, other minorities, the unemployed, etc.
In Australia, high schools are ranked based on final exam scores and that's something teachers already hate. But to tie it to pay would lead to an even larger conflict of interest and attempts to cheat the performance indicators. When I was graduating high school, I noticed that all of our raw marks were reduced right before our final exams (they were reduced because the metric takes into account whether the school was "harder" on students than the national exam or "easier" on them, and rewarded "harder" schools).
If this was just done to change a ranking, imagine what would happen if teacher's pay was linked to performance. Hell, what about rural or "bad neighbourhood" areas? Should we always and forever doom them to have bad teachers because all the good ones go somewhere with better pay? This is already happening (because working for a higher-ranked school is better for your career) and is pretty bad -- having performance-based pay would be a disaster.