Recommitment, which is when a person serves a prison term, is released and then is placed back in prison for an extended term, is a special kind of imprisonment that does not violate the constitution's ex-post facto or double jeopardy laws. Because the imprisonment doesn't violate the constitution, it allows courts to rule to place a habitual sex offender in prison for extended periods of time for the safety of the public.
There are several reasons you may find this unfair. For one thing, the typical way the law works is that once you've served your time in prison, you're released. You normally can't be tried or imprisoned again for the same crime without new evidence of some kind. Civil commitment is the exception to that rule.
Texas allows civil commitment similarly to the way Minnesota does. There, the civil commitment law is used for habitual sex offenders fairly often, allowing them to place those deemed "sexually dangerous" or as a "sexual psychopath" behind bars for an undefined term. This isn't meant to be a punishment; instead, the commitment is meant to be used to eliminate the risk of dangerous sexual behavior and to provide medical or psychological help to that individual.
There are a few ways a habitual offender can be identified. A person who has the lack of control over his or her impulses may be considered to have a sexual psychopathic personality. Those with habitual actions of sexual misconduct may also be listed as such.
A commitment hearing is held before you would be determined to be this type of sex offender. A judge makes the determination, and interestingly, the burden of proof is not as high as in a criminal case, making it easier to place someone under civil commitment. It is possible to be released from civil commitment, but the best course of action is to fight being placed under this terminology in the first place.
Source: FindLaw, "Civil Commitment for Sex Offenders" accessed Feb. 17, 2015