It’s not every day that a federal judge steps down from the bench to shake the hands of the two criminal defendants before him, offer an apology and vacate their convictions. That U.S. District Judge Richard D. Bennett did so Monday when Umar Bradley and Brent Matthews appeared before him — and that Mr. Burley said afterward that, nice though the gesture was, it will not undo the wreckage done to his life during the seven years he spent in prison on a wrongful conviction — just begins to reveal the damage caused by the massive corruption scandal in the Baltimore Police Department’s Gun Trace Task Force.

Messrs. Burley and Matthews were the two men who pleaded guilty after a member of the task force, Sgt. Wayne Jenkins, planted drugs in Mr. Burley’s car after a high-speed chase that resulted in the death of an 87-year-old man, police and prosecutors say. Mr. Burley spent seven years in prison before he was released in August, and Mr. Matthews was incarcerated for nearly four. More exonerations may well be on the way — federal public defenders are seeking to overturn the conviction of Levar Mullen, a Safe Streets worker who accepted a plea deal on a handgun charge after task force officers arrested him in 2014. He said at the time that the officers lied about the justification for stopping and searching him, and that claim must be given new weight after the revelations about the task force members’ own illegal acts. City prosecutors have taken steps to drop charges or release 175 people as a result of the task force’s corruption, and the Maryland public defender’s office says more than 2,000 cases are “irreparably tainted.”

Some of the people who will be freed as a result are probably innocent and have been wrongly accused. Others may well be guilty, meaning that dangerous criminals will be back on the street. Baltimore juries, already famously skeptical of police, will now be that much less inclined to take officers at their word, and witnesses will now be even more reluctant to cooperate with cops who have now been tarnished by association.

It is unfair, of course, to mistrust all Baltimore police because of the actions of a few. But it’s equally wrong to write off the Gun Trace Task Force as a rogue unit and absolve the department of blame. The fact that these officers were able to do what they did for so long reflects an utter failure, over multiple administrations, of the Baltimore Police Department to police itself.

That truth was underscored by Sun reporter Justin Fenton’s account Sunday of confidential files related to a 2009 internal affairs investigation into actions by one of the task force members who pleaded guilty this year, Detective Jemell Rayam. Years before he joined the task force, Mr. Rayam took part in a traffic stop downtown after which a Baltimore man accused officers of stealing $11,000 in cash. In the initial investigation, Mr. Rayam claimed that he did not know the officer who initiated the stop and who was accused of taking the money. But he later acknowledged that the officer, Michael Sylvester, was an old friend, and investigators discovered that the two had communicated by cellphone 500 times in the four-month period around the alleged theft and 34 times on the day of the traffic stop.

He lied. No question about it. But while Mr. Sylvester would agree to resign rather than be fired, Mr. Rayam would be cleared by a police trial board, reinstated and, later, promoted.

Until recently, trial boards took place behind closed doors, and under the terms of the Law Enforcement Officers’ Bill of Rights, they provide a notoriously friendly audience for officers accused of wrongdoing. Police Commissioner Kevin Davis and Mayor Catherine Pugh are certainly right to push for a change in state law that would require civilian participation on the boards. Perhaps civilians would have been less likely to give a police officer a pass for making a false statement, knowing what would happen to an ordinary person who did so under those circumstances. We also certainly hope Mr. Davis’ spokesman is right that the internal affairs division has been substantially upgraded since the 2009 investigation and that the department is now better able to identify and deal with problem officers.

But even if that is true, even if Baltimore’s internal affairs division is now the best it can be and a case like Mr. Rayam’s would never go unpunished, the department still labors under the legacy of years in which bad cops like him were returned to the street. How many more Rayams are left in the ranks, undetected? The Gun Trace Task Force case may be the most consequential corruption scandal to hit the Baltimore Police Department, but it is certainly not the first. Judge Bennett said Monday that he’s “afraid this is not over yet.” We are too.