The Eighth Amendment permits legislatures to enact punishments that meaningfully contribute to a legitimate penological purpose. It is the role of courts to guard against legislative excess; i.e. enacting sentences that are excessive and do not meaningful contribute to a valid penological purpose. Justice Kennedy wrote in Kennedy v. Louisiana:

Evolving standards of decency must embrace and express respect for the dignity of the person, and the punishment of criminals must conform to that rule. See Trop, supra, at 100 (plurality opinion). As we shall discuss, punishment is justified under one or more of three principal rationales: rehabilitation, deterrence, and retribution. See Harmelin v. Michigan, 501 U. S. 957, 999 (1991) (Kennedy, J., concurring in part and concurring in judgment); see also Part IV–B, infra. It is the last of these, retribution, that most often can contradict the law’s own ends. This is of particular concern when the Court interprets the meaning of the Eighth Amendment in capital cases. When the law punishes by death, it risks its own sudden descent into brutality, transgressing the constitutional commitment to decency and restraint.