Two painful, recent stories illuminate complex controversies that surround Minnesota's practice of locking up certain sex offenders in a "treatment program" after they've served prison sentences for their crimes.

The quite different offenders in the news this month are Eric Terhaar and Danny Heinrich. The program is known as MSOP (the Minnesota Sex Offender Program).

Heinrich, of course, is the now-confessed murderer of 11-year-old Jacob Wetterling. He was finally brought to a measure of justice 27 years after his evil deed. But many Minnesotans have been understandably infuriated that justice for Heinrich can't be more harsh. No trial for murder, kidnapping or sexual assault; no life in prison, much less a death sentence. Just 20 years, with time off for good behavior, on a child porn charge.

But officials eager to defend the outcome were quick to point out after Heinrich's excruciating confession that prison might not be the end of consequences for Jacob's killer. "[H]e may be subject to civil commitment by state or federal authorities … after his release," according to the plea agreement.

Most telling was the way U.S. Attorney Andrew Luger employed this information to close his news conference on the confession. Rejecting any suggestion that Heinrich was getting off too easily, Luger declared: "He's 53 years old. He will do 20 years in a federal prison and after that potentially more time under civil laws. He's not getting away with anything."

One could hardly ask for a clearer indication that the U.S. attorney regards civil commitment as a form of punishment and a continuation of it. Heinrich will do "more time under civil laws," we're assured.

Trouble is, the only lawful justification for civil commitment of offenders who have already done their "time" is treatment — not punishment. It is as a legitimate "treatment program" that Minnesota has in recent years defended MSOP against a class-action lawsuit challenging its constitutionality, now under appeal. Committed sex offenders need treatment, it's argued, before it's safe to release them to the community.

But treatment doesn't sound much like what a monster such as Heinrich deserves — so for public consumption, commitment was described candidly as "more time."

Eric Janus, a law professor at Mitchell Hamline School of Law and a leading critical expert on civil commitment laws, agrees Heinrich should receive a "long period of punishment." But he adds that "commitment is not punishment" and "the availability of civil commitment being put forward to make up for what may be seen as inadequate punishment is not an appropriate use."

What's more, we can't know what the civil commitment program will look in 20 years, Janus says, or how dangerous Heinrich will still be by then.

It's worth emphasizing here that Heinrich really isn't getting all he deserves. He's getting all the law can give him under all the circumstances. And that raises a question that in turn sheds light on the problem with civil commitment, at least as practiced in Minnesota.

Exactly why don't we just string Heinrich up from the nearest lamp post? Why don't we retroactively — and just in Heinrich's case — make death the penalty for child pornography possession?

Oh, sure, the U.S. Constitution says we shouldn't have retroactive "ex post facto" criminal laws or "bill[s] of attainder" (special criminal laws for specific people). But what did those old, dead white guys know about justice?

The answer, of course, is that we give beasts like Heinrich better than they deserve because we are a nation of laws. We believe the preservation of freedom ultimately depends upon everyone being guaranteed "due process" and "equal protection," however strong the temptation to deny it in a particular case. We believe it can never be safe to grant government arbitrary powers to punish people, except in strict accordance with laws and procedures that apply equally to all.

The trouble is that, in MSOP, Minnesota has been wielding arbitrary power, crowding America's largest per capita sex offender gulag with offenders incarcerated under inconsistent standards and with no serious review of their progress in treatment or continued dangerousness. Or so ruled U.S. District Judge Donovan Frank a year ago, in declaring MSOP unconstitutional and ordering that serious reviews of individual cases begin.

The state has appealed Frank's ruling before a federal appeals court. Its decision is expected this fall, and the outcome is uncertain. Over the years, notwithstanding the strong rulings of Frank and a few other judges, both federal and state courts have often deferred too generously to politicians on these matters.

Even so, there are signs of change in Minnesota, with state courts and state officials moving a few MSOP offenders toward less-restrictive levels of supervision. Many other states already do this far more effectively, largely because their civil commitment programs haven't been weaponized by politicians of both parties repeatedly accusing one another of being soft on predators, as has shamefully happened here.

All of which brings us to the case of Eric Terhaar. If Danny Heinrich is a chilling example of the kind of predator civil commitment may be most suitable for, Terhaar is an example of the kind of lost soul who can be buried alive in a too-sweeping program that fails to provide due process.

Terhaar, 26, has this month become the first person ever ordered fully and unconditionally released from MSOP in its whole history. A panel of three judges ordered his release after seven years, and the state has decided not to contest the matter further.

As related in the special court's ruling, Terhaar's story is another, very different tale of a victimized child. Repeatedly abandoned and mistreated from infancy on, Terhaar has seldom lived outside institutions and suffered sexual and physical abuse both in foster homes and public facilities. His only sexual misdeeds were nonviolent and committed as a kid.

Forcefully sweeping aside the state's arguments for keeping Terhaar locked up, the court wrote that he poses no meaningful danger and his "treatment needs … can be met in the community [and] are a result of childhood abuse and years of institutionalization …

"[He] does not belong at MSOP and may never have," the judges wrote.

Like I said, two painful stories — and a reminder that there's more than one way justice can be denied.

D.J. Tice is at Doug.Tice@startribune.com.