In 1976, just six months after he joined the Supreme Court, Justice John Paul Stevens voted to reinstate capital punishment after a four-year moratorium. With the right procedures, he wrote, it is possible to ensure “evenhanded, rational and consistent imposition of death sentences under law.”

In 2008, two years before he announced his retirement, Justice Stevens reversed course and in a concurrence said that he now believed the death penalty to be unconstitutional.

But the reason for that change of heart, after more than three decades on the court and some 1,100 executions, has in many ways remained a mystery, and now Justice Stevens has provided an explanation.

In a detailed, candid and critical essay to be published this week in The New York Review of Books, he wrote that personnel changes on the court, coupled with “regrettable judicial activism,” had created a system of capital punishment that is shot through with racism, skewed toward conviction, infected with politics and tinged with hysteria…

Justice Stevens said the court took wrong turns in deciding how juries in death penalty cases are chosen and what evidence they may hear, in not looking closely enough at racial disparities in the capital justice system, and in failing to police the role politics can play in decisions to seek and impose the death penalty…

“That the murder of black victims is treated as less culpable than the murder of white victims provides a haunting reminder of once-prevalent Southern lynchings,” Justice Stevens wrote…

He was also critical of decisions allowing prosecutors to exclude jurors with qualms about the death penalty, tilting the legal playing field toward conviction.