California actually spends less per student on education than even many poor states. For all their virtue signaling about public transport, CA don't even have universal school bus service (which is table-stake in most states). Most parents drive individually and drop kids!
Just compare the building/facilities of any top bay area public school with that of Texas. The former look like shack while the latter look like mini universities. Bay area schools still rank higher because of students and parents, its nothing to do with the state.