No good deed goes unpunished. Take Mayor Michael Bloomberg’s brave decision to lay off 3,600 employees -- including teachers and principals -- of 24 of New York City's worst-performing schools, all with an eye toward rebooting them with new staff, management plans, and curricula. The outgoing staff were told they could reapply, but would have to compete with thousands of new applicants. The goal: Turn around the schools by turning them inside out. Naturally, the teachers’ unions pitched a fit, and have done everything they can to thwart the Mayor’s plan. The irony is that, as is so often the case, unions brought this pain on themselves. Bloomberg’s original plan was to institute a comprehensive instructor evaluation plan in order to, as The Wall Street Journal editorial board put it, “smoke out the lowest performing educators.” But New York’s powerful United Federation of Teachers (UFT) strongly objected to this effort to locate incompetent instructors, forcing Bloomberg into his plan B -- mass layoffs at the two dozen worst-performing schools. To no one’s surprise, this, too, was unacceptable to the UFT, which claimed the city’s actions violated the teacher’s collective bargaining agreement. And so off the case went to arbitration, where the Mayor got his hat handed to him: sole arbitrator Scott Burchheit scrapped the planned reboot of the failing schools because, he found, “a wish to avoid undesirable teachers was the primary, if not exclusive reason” for the closings. In other news, mice like cheese. The Mayor’s office appealed the decision, but suffered another defeat on July 24 when State Supreme Court Judge Joan Lobis sided with the arbitrator, who had sided with the unions, all of whom sided against the kids languishing in NYC’s educational hell. Explained Lobis of her decision: “Since I find that the staffing questions are covered by provisions in both the collective bargaining agreements, I believe the arbitrator was within his authority to determine this grievance.” The judge seemed especially swayed by the union’s argument that the firings violated so-called “first-in, last-out” seniority rules that make it almost impossible to fire long-ensconced teachers. “The issue of staffing is intertwined with the questions of seniority, excessing and discipline of teachers and supervisors, all of which are specifically covered by the collective bargaining agreements,” noted the Judge. What will happen in the wake of these union victories? UFT attorney Adam Ross made union demands clear, boasting that the Mayor and his allies have, “now lost at arbitration level, they’ve lost at Supreme Court,” and that the union “would like to get to the business of staffing these schools and getting ready for the opening of schools in September.” Bloomberg’s crew is putting up a brave front. “The mayor and chancellor will not allow failing schools to deprive our students of the high-quality education they deserve,” said the city’s chief council Michael A. Cardozo after Lobis’ decision. “Although we will of course comply with the judge’s ruling, we strongly disagree with it — and we will be appealing.” But with the state appellate courts out of session, and the new school year rapidly approaching, the fired employees of the 24 schools -- all of which have a graduation rate under 60 percent, and some as low 39 percent -- will now likely be unfired, and thousands of children will be subjected once again to the indifference and incompetence of teachers shielded from accountability by the UFT protection racket. According to the New York State Education Department, only 60.9 percent of New York high school students graduate within four years, even as unions consistently block any attempt to impose teacher accountability. Maybe it’s time Gotham students formed a union of their own.