The Police Union and the Teacher's Union have certainly been reported to be responsible for making it hard to fire people.
Some of this just comes down to both being local government jobs run by a multitude of independent systems some of which are going to be far below average. There are ~13,506 school districts in the US, so the bottom 5% consists of 675 different systems with a huge range of issues.
The other issue is it can be hard to get replacements.
https://www.washingtonpost.com/graphics/2017/investigations/...
A cop can be fired for sexually assaulting a teenager in his squad car, and end up getting rehired by the same department.
I'm not anti-union but it's a double edged sword.