Proponents say ‘civil-commitment’ programs protect the public while detractors argue they violate civil liberties.