It's constitutional as an exercise of California's power under the 10th Amendment. This is a pretty well settled area of Constitutional law, as the US has had plenty of epidemics of various diseases (cholera, typhus, yellow fever, influenza, and even bubonic plague) in the 19th and early 20th centuries that provided opportunity to litigate these issues.