It's state law. From the DMV:
21720. A pocket bike shall not be operated on a sidewalk, roadway, or any other part of a highway, or on a bikeway, bicycle path or trail, equestrian trail, hiking or recreational trail, or on public lands open to off-highway motor vehicle use.
From the Highway Patrol, definition of various types of motor bikes and where they can be ridden:
http://www.chp.ca.gov/html/motors.html