In a Twitter post about Mr. Newsom’s moratorium, Mr. Trump wrote, “friends and families of the always forgotten VICTIMS are not thrilled, and neither am I!”

The issue illuminates ideological and generational divides among many Democratic voters. Many of the presidential candidates are on record opposing capital punishment; Joseph R. Biden Jr., the former vice president who is expected to enter the race in the coming weeks, has supported it.

As a senator in the 1990s, Mr. Biden supported many get-tough-on-crime policies that liberals now disavow, including limits on appeals for death row inmates.

“Biden was one of the major proponents of the 1994 amendments that severely limited the ability of death row prisoners to obtain meaningful judicial review,” said Robert Dunham, the executive director of the Death Penalty Information Center, a nonprofit group that provides analysis and information on capital punishment. “Other people who have sponsored that bill have said they thought that was a mistake. And I think that voters will have to decide whether candidates for office have made mistakes and learned from them, or whether they are professing new views because the views of the public have changed.”

While Ms. Harris has long opposed capital punishment, she has a somewhat complicated history on the issue. As the district attorney in San Francisco, she refused to seek a death sentence for a defendant accused of murdering a police officer, provoking outrage from the right. But she defended California’s death penalty as the state’s attorney general, and twice, in 2012 and 2016, she refused to take a stand on ballot initiatives that proposed to abolish it.

Aside from Mr. Biden, most of the other candidates have opposed the death penalty. In addition to Ms. Harris and Mr. O’Rourke, who have said they would support a federal moratorium, Senators Bernie Sanders, Cory Booker, Elizabeth Warren and Kirsten Gillibrand all said they support Mr. Newsom’s moratorium. Two others in the race — John Hickenlooper, former governor of Colorado, and Jay Inslee, governor of Washington — imposed moratoriums in their states.

“It’s kind of interesting that they are talking about it because it had pretty much dropped off the radar for national campaigns,” said Kent Scheidegger, the legal director of the Criminal Justice Legal Foundation, a group based in Sacramento that has led campaigns in California and across the country in support of the death penalty. “I’d love to see it made an issue.”