The ruling is a victory for death row inmate Terrance Williams who now gets a new hearing before the Pennsylvania state Supreme Court to challenge his sentence.
As a member of the Pennyslvania state Supreme Court, Judge Ronald D. Castille voted to reinstate the death penalty. Williams argued that he should have recused himself from the case due to his previous involvement.
Thursday's ruling was 5-3. "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 Justice Anthony Kennedy in the majority opinion.
"Today's ruling is a clear message to lower court judges that the Constitution imposes its own recusal requirement in cases in which there is too great a risk that the judge will be biased," said Steve Vladeck, CNN contributor and professor of law at American University Washington College of Law.
"The majority's focus on the appearance of bias, rather than actual bias, should be a sobering lesson to all jurists about their ability to act fairly and impartially in cases in which they were previously involved in a different capacity," Vladeck added.
Williams was convicted in 1984 of the murder of 56-year-old Amos Norwood in Philadelphia.
Williams' lawyers argued that his case was "extreme and rare" and stressed that not only did Williams object to Castille's casting a vote in his case, but that the vote related to Williams's specific claim that the trial prosecutor in his case -- who had once been under Castille's direct supervision -- had engaged in misconduct by withholding information.
Chief Justice John Roberts and Justices Samuel Alito and Clarence Thomas dissented, and Roberts pointed out that Castille did not partake in that misconduct.
"Neither the contested evidence nor the legal issues were ever before him as prosecutor," Roberts wrote. He added, "Because the Due Process Clause does not mandate recusal in cases such as this, it is up to state authorities—not this Court—to determine whether recusal should be required."
Pennsylvania had argued that Castille did not have significant involvement in the case and that he was the head of a large district attorney's office in a city that saw many capital murder trials and Williams. But Kennedy said Castille made a "critical choice" and that "without his express authorization" the state would not have been able to purse the death sentence against Williams.
"A multimember court must not have its guarantee of neutrality undermined, for the appearance of bias demeans the reputation and integrity of not just one jurist, but of the large institution of which he or she is a part," Kennedy wrote.
Kennedy, who was joined by Justices Ruth Bader Ginsburg, Stephen Breyer, Sonia Sotomayor and Elena Kagan wrote, "The due process guarantee that 'no man can be a judge in his own case' would have little substance if it did not disqualify a former prosecutor from sitting in judgment of a prosecution in which he or she had made a critical decision."
The ruling comes as the issue of judicial recusal has been in the news as Donald Trump suggested that an Indiana-born judge of Mexican heritage is biased against him for his proposal to build a border wall.
Elizabeth Wydra of the progressive Constitutional Accountability Center said that Thursday's ruling is a clear contrast with Trump's bias claims.
"As the court made clear both the appearance and reality of impartial justice are crucial in our justice system," she said. "The facts of today's case show what a real risk of judicial bias looks like, instead of specious assertions based on race or ethnicity."