It's hard to fairly measure and evaluate "merit" for teachers. You can be the best teacher of the world, prepare every single lesson for hours according to the most modern scientific standards - and yet have half your class fail in tests because they literally didn't have anything to eat since the warm school-provided lunch yesterday. Food scarcity is a problem affecting at least 75% of US school districts [1], it's gotten way worse since the COVID assistance ended [2], and it has been shown in studies to be closely linked to performance [3] (hardly a surprise for anyone who ever had to experience food scarcity).
The teacher unions do have a point there, because introducing anything "merit" based only punishes those teachers and school districts for stuff they can't control, much less actually solve.
Unions are on the rise, and we need them to seize more power in every sector of labor to fight against extreme wealth inequality. I fully support the teacher's unions. More often than not, they include resources for their students in their negotiations.
I'd also say part of the cause of this are the teacher unions. When we don't do merit based promotions and raises, people don't care as much.