Although Macon Baker completed his prison sentence in 2006, the state of Missouri kept him behind bars, repeatedly trying to commit him as "sexually violent predator." After three juries deadlocked on the question of whether Baker suffers from a "mental abnormality" that makes him "more likely than not" to commit new sex crimes after he is released, a fourth jury on Friday unanimously agreed he does not. In effect, the state retroactively extended Baker's sentence from 10 years to 17.

The military prison at Guantanamo Bay is notorious as a place where people can be held indefinitely without charge because the usual rules of criminal justice do not apply. Twenty states have their own versions of Guantanamo Bay for sex offenders, a fact that attracts little attention and generates little outrage because the detainees are even less sympathetic than suspected terrorists.

At the age of 18, the St. Louis Post-Dispatch reports, Baker "got caught sticking his hand in the pants of a 5-year-old girl playing in a yard." He pleaded guilty to sexual abuse, got probation, and underwent treatment. Fourteen years later, after he was arrested for molesting the 7-year-old daughter of close friends, he was sentenced to 10 years in prison.

You may well think a 10-year sentence is too short for a child molester. The prosecution thought 25 years would have been appropriate. But that is not the sentence Baker got, and lengthening a prison term after it has been completed is a practice usually associated with arbitrary dictatorships, not liberal democracies that supposedly respect the rule of law.

When it upheld a law similar to Missouri's in the 1997 case Kansas v. Hendricks, the Supreme Court said preventive detention of sex offenders is constitutional as long as the aim is not "punitive" and the procedures for committing people meet the requirements of due process. In a concurring opinion, however, Justice Anthony Kennedy warned that if the official rationale for commitment is treatment, "but the treatment provisions were adopted as a sham or mere pretext," that fact would indicate "the forbidden purpose to punish."

Missouri's Sex Offender Rehabilitation and Treatment Services (SORTS), the target of a federal lawsuit that argues it locks people in a prison disguised as a hospital, seems to illustrate Kennedy's point. "Since the program started in 1999," the Post-Dispatch reports, "nobody has completed treatment." In a 2009 memo, the director of Missouri's Department of Mental Health worried that such a record would prove SORTS is nothing but a "sham."

Minnesota, with more civilly committed sex offenders per capita than any other state, has a similarly dismal record, even though it spends $120,000 a year to detain each of those "patients," three times the cost of keeping someone in prison. Last week, in a ruling that allowed a lawsuit challenging the Minnesota Sex Offender Program (MSOP) to proceed, U.S. District Judge Donovan Frank noted that "no civilly committed sex offender has ever been discharged." Assuming the facts alleged by the plaintiffs are true, he said, "it appears that MSOP may very well be serving the constitutionally impermissible purposes of retribution and deterrence."

Siome states have better records. But over all, as you might expect given the incentives involved, civilly committed sex offenders are almost never deemed to be "cured," so they are almost never released.

In Kansas v. Hendricks, the Supreme Court emphasized that a sex offender could be committed only if he suffered from a "mental abnormality" or "personality disorder" that undermined self-control, justifying "a prediction of future dangerousness." But according to Justice Department data, most prisoners have "mental health problems," and many of them surely have behaved in ways that would make a "prediction of future dangerousness" plausible.

Is that all it takes to lose your freedom forever? If so, the idea that people should be imprisoned only for crimes they have already committed, as opposed to crimes they might commit in the future, may one day seem positively quaint.