Reading about this today, I found that the scope of this particular decision is less scary than I initially assumed -- it's limited to prisoners who meet a standard as being "sexually dangerous", so they're not just being held without due process. Apparently this applies to about 100 prisoners nationwide.
The trouble here is that we, as a society, have real trouble in applying common sense in our legal system. You start with an obvious good thing (keeping violent sex offenders behind bars) and it grows into something completely different -- consider the way the term "sex offender" has been distorted. Once you start allowing this sort of action, where's the protection that keeps it from growing into something else?
Are we going to start seeing 18 year-olds locked up forever because they had sex with a girl a few months younger than them? It sounds silly, but we already routinely label this a "sex offense". Will taking a drunken piss in an alley set you up for decades in prison? Again, common sense says that's ridiculous but again, it can already get you labeled as a sex offender.
Until we figure out a way to legislate in a way that applies some degree of common sense, this sort of thing just can't be allowed.