Cal. Gov't Code § 202
The state may imprison or confine for the protection of the public peace or health or of individual life or safety.