This article original appeared on Huffington Post by Christian Farias on June 9th, 2016.

The Supreme Court ruled on Thursday that Pennsylvania’s former top judgeviolated the Constitution when he failed to sit out the case of a young man for whom he had recommended the death penalty back when he was district attorney.

The high court’s case was chiefly a dispute over when a judge’s impartiality can be questioned — an area that’s become fodder for Republican presidential politics in recent weeks. But the legal journey of Terrance Williams, who at 18 was sentenced to die for murdering a man who may have sexually abused him, is far worse than anything an unhinged candidate may rattle on about.

Williams’ case illustrates the systemic failures of the criminal justice system — from prosecutorial misconduct and use of false witnesses to tough-on-crime judicial politics and the arbitrariness of the death penalty.

Justice Anthony Kennedy does a good job of summarizing the crooked road the case took in the Supreme Court’s majority ruling.

On the key point, Kennedy said that Ronald Castille, then chief justice of the Pennsylvania Supreme Court, should have recused himself when his court considered Williams’ appeal because nearly 30 years ago, he had been the district attorney who gave the green light to seek the death penalty against Williams.

“Where a judge has had an earlier significant, personal involvement as a prosecutor in a critical decision in the defendant’s case, the risk of actual bias in the judicial proceeding rises to an unconstitutional level,” wrote Kennedy, joined by his four liberal colleagues.

“Due process,” he continued, “entitles Terrance Williams to a proceeding in which he may present his case with assurance that no member of the court is predisposed to find against him.”

For a long time, Williams hadn’t realized that Castille, who served on the state Supreme Court from 1994 to 2014, was ever really involved in his case. But Castille certainly knew how he felt about capital punishment: He campaigned to become chief justice on his record of sending 45 people to death row as Philadelphia’s district attorney.

Over the course of 26 years, Williams mounted numerous appeals to little avail until he finally came across information that a key witness had been offered a special deal to testify falsely against him and that prosecutors had failed to turn over information that might have exonerated him. Williams then sought access to the prosecution’s whole file. That uncovered the memorandum signed by Castille that turned William’s prosecution into a death penalty case, as well as other information critical to his defense.

Learning all of this, Williams tried to get his sentence thrown out by Pennsylvania’s high court. The defendant also specifically asked that Castille disqualify himself from the case, given his earlier participation as district attorney. The chief justice refused that request and then joined his colleagues in upholding the death sentence.

Castille’s involvement created “an unconstitutional risk of bias,” Kennedy wrote.

“Chief Justice Castille’s participation in Williams’s case was an error that affected the State Supreme Court’s whole adjudicatory framework,” Kennedy wrote. “Williams must be granted an opportunity to present his claims to a court unburdened by any possible temptation … not to hold the balance nice, clear and true between the State and the accused.”

Chief Justice John Roberts, joined by Justice Samuel Alito, disagreed and noted that all Castille did back in 1986 was make the decision to seek the death penalty — and that any other misconduct or withheld evidence bore no connection to that decision.

“The Due Process Clause did not prohibit Chief Justice Castille from hearing Williams’s case,” Roberts said. He suggested that state ethics rules might be a better avenue to determining when a judge should recuse.

Justice Clarence Thomas dissented alone to declare that this case didn’t even implicate the Constitution.

“This is not a case about the accused. It is a case about the due process rights of the already convicted,” he wrote. “Whatever those rights might be, they do not include policing alleged violations of state codes of judicial ethics.”