Justices split 5-4 in the term's oldest case, which was argued in December before Justice Sandra Day O'Connor's retirement. A new argument session was held in April so that Alito could break a deadlock.
The justices are in the final week of their term and handling some of the most contentious and important cases. They meet again Wednesday to announce more decisions.
The Kansas case was unique. The state law says juries should impose death sentences if aggravating evidence of a crime's brutality and mitigating factors explaining a defendant's actions are equal in weight.
Justice David H. Souter, writing for the liberals, said the law was "morally absurd."
Writing for the majority, Justice Clarence Thomas disputed the claim by critics that the law created "a general presumption in favor of the death penalty in the state of Kansas."
The ruling affirms the court's long-held position that states should determine how juries weigh factors presented by the prosecution and defense in capital cases.
Fifteen states filed friend-of-the-court briefs, predicting that a ruling for former death row inmate Michael Lee Marsh would have required states with capital punishment to set up systems for juries to weigh evidence at sentencing.
Souter said that "in the face of evidence of the hazards of capital prosecution," maintaining a system like the one in Kansas "is obtuse by any moral or social measure."
Marsh was convicted in the June 1996 killings of Marry Ane Pusch and her 19-month-old daughter, Marry Elizabeth. Pusch was shot, stabbed and her throat was slit. Her body was set on fire. The toddler died several days later from severe burns.
In its December 2004 ruling striking down the death penalty law, the Kansas court also invalidated Marsh's capital murder conviction for the child's death, saying Marsh's attorneys should have been allowed to present evidence that someone else was connected to the murders.
No one has been executed since the law took effect in 1994 and the last execution in Kansas was in 1965.
"I'm pleased this issue is resolved, and the status of our death penalty is settled," Gov. Kathleen Sebelius said. "Without this ruling, the decisions the juries made concerning the eight Kansas death-row inmates would be in jeopardy. I hope this will bring some closure to the families who have been waiting for this issue to be resolved."
Bill Lucero, the leader of a Kansas-based anti-capital punishment group, Murder Victims' Families for Reconciliation, called Monday's ruling disappointing. It "just doesn't make sense" to mandate death when aggravating and mitigating circumstances are equal, he said, adding that capital cases — and the pressure they put on prosecutors to win death sentences — lead to errors.
Justice Antonin Scalia wrote a separate opinion on Monday to defend the death penalty and the court's ruling in the Kansas case.
"The American people have determined that the good to be derived from capital punishment — in deterrence, and perhaps most of all in the meting out of condign justice for horrible crimes — outweighs the risk of error. It is no proper part of the business of this court, or of its justices, to second-guess that judgment, much less to impugn it before the world ...," Scalia wrote.
Kent Scheidegger, legal director of the pro-death penalty Criminal Justice Legal Foundation, said the decision "signals that a majority of the court is not inclined to invent new procedural restrictions on the death penalty."
The case is Kansas v. Marsh, 04-1170.