WASHINGTON—President Biden, citing moral and policy objections to capital punishment, said he was commuting the death sentences of 37 inmates Monday, a move that prevents President-elect Donald Trump from executing most men on federal death row.

“Make no mistake: I condemn these murderers, grieve for the victims of their despicable acts, and ache for all the families who have suffered unimaginable and irreparable loss,” Biden said in a statement.

But, citing his early experience as a public defender as well as decades in federal office, “I am more convinced than ever that we must stop the use of the death penalty at the federal level,” the president said. “In good conscience, I cannot stand back and let a new administration resume executions that I halted.”

The 37 men, all convicted of murder, will serve life imprisonment without parole.

Biden left death sentences in place for three inmates found guilty of terrorism or hate-motivated mass killings: Dzhokhar Tsarnaev , who with his now-dead brother bombed the 2013 Boston Marathon , killing three and wounding more than 250 others; Robert Bowers , who killed 11 people in the 2018 attack on the Tree of Life synagogue in Pittsburgh; and Dylann Roof , who in 2015 killed nine at the Emanuel African Methodist Episcopal Church in Charleston, S.C.

Also excluded are four servicemen convicted of murder and held on the military death row at Fort Leavenworth, Kan.

Those spared include a former Marine who killed two young girls and later a female naval officer; a Las Vegas man convicted of kidnapping and killing a 12-year-old girl; a Chicago podiatrist who fatally shot a patient to keep her from testifying in a Medicare fraud investigation; and two men convicted in a kidnapping-for-ransom scheme that resulted in the killings of five Russian and Georgian immigrants.

Biden’s decision comes after weeks of wrestling over the condemned men’s fate , which became more urgent after Trump’s victory in the presidential election. Religious and civil-rights groups had called on the president to act before turning the White House over to Trump, whose attorney general, William Barr , prioritized executions and saw 13 inmates put to death at the federal prison in Terre Haute, Ind.

Last week, Senate Minority Leader Mitch McConnell (R., Ky.) cautioned Biden to show the condemned men no mercy.

“Let’s be clear what commuting these sentences would mean,” McConnell said in a floor speech. “It would mean that the laws passed by Congress and applied by our judges and juries have no value.”

Abolitionist groups ranging from the American Civil Liberties Union to the U.S. Conference of Catholic Bishops had called for blanket commutation of all 40 men on the federal death row, arguing that the issue wasn’t the depravity of the convicts’ crimes but a moral standard the government should uphold.

Earlier this month, Pope Francis , in his weekly address, prayed for the commutation of America’s condemned inmates—something the Vatican news service noted was a power Biden retained into January. Biden, who is Catholic, spoke with Francis Thursday and is scheduled to meet with him at the Vatican next month, the White House said.

But people familiar with the matter said Biden ultimately accepted the recommendation of Attorney General Merrick Garland , who as a Justice Department official in the 1990s oversaw the capital prosecution of Oklahoma City bomber Timothy McVeigh and supports the death penalty for terrorism and hate crimes.

Those convicts’ death sentences are in line with prosecutorial guidelines Garland issued during his tenure as attorney general.

Before Trump’s presidency, only three federal inmates, including McVeigh, had been put to death since the Supreme Court in 1976 established the modern framework for capital punishment. Trump-transition officials didn’t respond to requests for comment, but in his 2024 campaign, the president-elect called for expanding the death penalty to human traffickers and drug dealers.

Biden listed abolition of capital punishment among the goals of his 2020 presidential campaign, but once in office did little to advance the project. In July 2021, Garland issued a moratorium on the death penalty so that Trump-era policies accelerating executions could be reviewed; according to a December court filing, that review is now nearing completion.

The Biden administration has continued to seek death sentences in a handful of cases, including that of Payton Gendron , who is awaiting trial in federal court for the 2022 mass shooting at a Tops supermarket in Buffalo, N.Y. Gendron already is serving a life term for the killings in state prison, the most severe sentence under New York law because the state has no death penalty.

The White House characterized the commutations as part of a broader effort to employ executive authority to redress unfair or excessive punishments in the criminal justice system. Earlier this month, for instance, he granted clemency to 1,500 people with federal convictions, and additional moves are planned, the White House said.

Advocates said they thought one pardon in particular helped move the president’s hand.

“I do believe by pardoning his son it puts an extra impetus on him to do the right thing,” Sister Helen Prejean , a prominent opponent of capital punishment, said last week. The president pardoned his son Hunter Biden , absolving him of tax and weapons convictions as well as any other federal crimes he may have committed over the past decade.

Capital punishment remains on the books in 27 states, but its use is concentrated in a handful with active death chambers. Of the 25 executions conducted in 2024, 76% took place in Alabama, Missouri, Oklahoma and Texas, the Death Penalty Information Center reported. Some 26 defendants were sentenced to death over the year, the center said.

At the state level, there are several instances of governors issuing blanket commutations of condemned inmates, often at the tail end of their terms. In December 2022, for instance, Oregon Gov. Kate Brown , a Democrat, commuted to life imprisonment the 17 inmates on the state’s death row.

Three days before leaving office in January 2003, Republican Gov. George Ryan of Illinois announced a blanket commutation for the state’s 167 condemned inmates .

“Our capital punishment system is haunted by the demon of error—error in determining guilt, error in determining who among the guilty deserves to die,” Ryan said.

Write to Jess Bravin at Jess.Bravin@wsj.com