On this federalism question, the Court relies on the Necessary and Proper Clause of the Constitution. The persons who are detained have, in every case, been convicted of federal crimes. If there was federal power to create those crimes and to impose criminal punishment for them, then why wouldn't it follow that the federal government could do something more to those individuals? Justice Breyer writes for the majority: "the same enumerated power that justifies the creation of a federal criminal statute... justifies civil commitment...."
[T]he statute is a “necessary and proper” means of exercising the federal authority that permits Congress to create federal criminal laws, to punish their violation, to imprison violators, to provide appropriately for those imprisoned, and to maintain the security of those who are not imprisoned but who may be affected by the federal imprisonment of others. The Constitution consequently authorizes Congress to enact the statute.Justice Kennedy writes separately to note that federalism concerns have been adequately tended to: "this is a discrete and narrow exercise of authority over a small class of persons already subject to the federal power." Ditto Alito: "This is not a case in which it is merely possible for a court to think of a rational basis on which Congress might have perceived an attenuated link between the powers underlying the federal criminal statutes and the challenged civil commitment provision. Here, there is a substantial link to Congress’ constitutional powers."
Justice Thomas dissents (joined by Justice Scalia):
Absent congressional action that is in accordance with, or necessary and proper to, an enumerated power, the duty to protect citizens from violent crime, including acts of sexual violence, belongs solely to the States....
Not long ago, this Court described the Necessary and Proper Clause as “the last, best hope of those who defend ultra vires congressional action.” ... Regrettably, today’s opinion breathes new life into that Clause, and... comes perilously close to transforming the Necessary and Proper Clause into a basis for the federal police power that “we always have rejected"... In so doing, the Court endorses the precise abuse of power Article I is designed to prevent—the use of a limited grant of authority as a “pretext . . . for the accomplishment of objects not intrusted to the government.”