Following its 2006 decision outlawing the execution of people who are convicted of crimes committed while juveniles, the U.S. Supreme Court found recently, in a 5-4 vote, that mandatory life sentences without parole for juveniles constitutes constitutionally proscribed cruel and unusual punishment.

As in the death penalty decision, the court found that advances in the understanding of juvenile brain development make mandatory life sentences without parole untenable.

Mandatory is the key word. The court found that life sentences without parole might well be appropriate in some cases, but that state legislatures may not require judges to impose that sentence in every case.

The ruling is a simple matter of justice, requiring the system to require each sentence on a case-by-case basis, rather than pretending that every case is the same.

The matter is particularly important in Pennsylvania. According to the Sentencing Project, a nonprofit, nonpartisan group that advocates fair sentencing, Pennsylvania has more juveniles serving life sentences without parole than any other state - about 380.

Last week the state Senate Judiciary Committee conducted a hearing in response to the Supreme Court decision, primarily about whether the ruling should apply to juveniles already automatically sentenced to life without parole, or only to new cases.

That is a difficult issue because sentence reductions naturally will produce angry reactions from victims' families, whose losses can't be recovered.

Yet that reflects the fact that sentencing must be difficult if it is to serve justice, that it must be the result of a careful process rather than the result of legislative mandates that inevitably are driven by politics as much as justice.

Pennsylvania's population of juveniles under life-without-parole sentences is especially high because of a double mandate. Every juvenile charged with first- or second-degree murder must be tried as an adult and, if convicted, must be sentenced to life without parole.

Mandatory sentences serve politicians' needs to be tough on crime more than they serve justice. State lawmakers should move quickly to restore the discretion that better serves justice.