Measuring performance is pretty much the job of managers (principals, in this case), and is difficult in every industry. That being said, some teachers are really, really obviously bad teachers that need to be fired (screaming at the class, throwing chairs at students, and teaching incorrect "facts" [like Mars being the smallest planet in the solar system]), but can't be fired because of union regulations.
"Importance of subject matter" isn't 100% opinion based (can't do most subjects without a good math, English, and science foundations), but this can also be rarity of teachers teaching a certain position. If there's a billion people teaching English, lower pay, if there's four people teaching music, higher pay.
That's actually not true. Unions in other industries inspire fierce, fierce loyalty. You ever talk to a longshoreman? Or a miner? They love the union. Pretty much any manufacturing union as well, or any job with low pay and high danger, specifically because they know that, without the union, they'd be dead or maimed inside a week. If Foxconn employers unionized (if, you know, they wouldn't get thrown in jail for 5 years for doing so), they'd love the union, too.
Teachers, even when the unions are negotiating a better contract for them, pretty much always hate the union. They might actually be unique in this; I have not heard of any unions more hated by their own members than the teachers' unions.