California Government Code Section 202

The state may imprison or confine for the protection of thepublic peace or health or of individual life or safety.