Almost all US case law has held that any jurisdiction can make anything illegal unless there's a specific higher-ranking (state or federal) law protecting that act from being made illegal.
There is supporting state statute law for public health orders to prevent communicable disease; that statute law is also what makes it a crime to violate such orders.
I'll just quote the first part (after the rather extended title) of the Alameda County order, which cites the statutory authority both for the order itself and for criminal prosecution of violations:
> Please read this Order carefully. Violation of or failure to comply with this Order is a
misdemeanor punishable by fine, imprisonment, or both. (California Health and Safety
Code § 120295, et seq.; Cal. Penal Code §§ 69, 148(a)(1))
> UNDER THE AUTHORITY OF CALIFORNIA HEALTH AND SAFETY CODE SECTIONS 101040, 101085, AND 120175, THE HEALTH OFFICER OF THE COUNTY OF ALAMEDA (“HEALTH OFFICER”) ORDERS: