Even by the standards of America's troubled jails and prisons, the scandal at the Baltimore City Detention Center is appalling.
A gang known as the Black Guerrilla Family took over the center, trafficking in drugs, cellphones and sexual favors with the connivance of at least 13 guards, several of whom are bearing a gang boss' children, according to a federal indictment.
Among the many lessons from this sorry situation is one that experience elsewhere has already taught many times:
Good governance is not necessarily consistent with the demands of government unions, in this case the union representing Maryland's correctional officers.
God-awful as it is, the mess at the center was not exactly unprecedented. Between April 2009 and August 2010, the Baltimore City Paper published 14 articles detailing gang-related corruption at state correctional institutions.
And it was during this time that Maryland's branch of the American Federation of State, County and Municipal Employees (AFSCME) lobbied for legislation known as the "Correctional Officers Bill of Rights."
Advertised as much-needed procedural protection against unfair accusations of brutality, COBR established elaborate rules - including a guaranteed appeal hearing in front of a three-member board of fellow officers - for correctional officers suspected of wrongdoing.
The bill says that prison managers can't even "threaten" prosecution, transfer, dismissal or disciplinary action during questioning.
It passed the House of Delegates unanimously and the Senate 44 to 2. Gov. Martin O'Malley, D, signed it into law on May 4, 2010.
In the union's view, prison administrators had "pulled the trigger too quickly" on discipline in the past, as AFSCME spokesman Jeff Pittman put it.
But according to an FBI special agent's affidavit attached to the Baltimore indictment, the act has all but disarmed managers at the Baltimore jail. Discipline "has proven to be very difficult," the agent wrote, and "the internal review process set up by COBR is ineffective as a deterrent to correctional officers] smuggling contraband or getting sexually involved with BGF gang members."
These consequences may have been unintended, but they were hardly unforeseeable. Shortly before COBR was passed in 2010, the City Paper asked the bill's chief sponsor, state Sen. Donald Munson, how it might affect the department's efforts to purge gang-connected correctional officers.
"I've never thought of this measure in this context," Munson replied. "My guess is that the correctional officers who are going to be judges are going to be very hard on those cases," he added. "If it doesn't work, we'll fix it in the future."