In my locality, the union is the last line of defense for teachers who don’t want to teach creationism, abstinence, and the like. Local politicians are far easier for a vocal minority to bully.
A lot of organizations actively undermine society by existing, but we generally have to respect freedom of association, even for people we don't like.
Police and teacher unions are terrible not because they are public servants but because our capitalist system provides them with no way to extract additional value.
Teachers don't have qualified immunity or get the privilege of shooting your dog, making it a pretty poor comparison.