The problem of excess teachers is the interaction between managements' reasonable desire to control staff deployment and unions' understandable desire to protect senior members through collective bargaining agreements. It's complicated tangle, but arose from managements' decision in the 1970's to give unions more control over hours and working conditions, when the ability to offer higher wages was constrained by stagflation. It was a short-sighted decision.
The responsibility for individual competence lies with each teacher; the responsibility for incompetence at scale rests with school management. Administrators - from principals to superintendents - have failed to put up the resources required to pursue staff termination on performance grounds. (I suspect they have also failed to do an adequate job of screening candidates up front, or providing support to "improvable" staff.) The firing process itself isn't incredibly complicated, but it does take time and effort to put together a credible record that will support termination. In this regard, school systems are no different from any large organization; line managers are not incentivized to spend the time required to coach, counsel out or end the careers of poor employees - or punished for failing to do so, and so they don't.
Understanding those 70's decisions is important, particularly to understanding urban systems. I know teachers who were around then, and they did take those rights in lieu of real money.