Your post actually explains why every single classmate of my daughter has enrolled in private middle school ($50k+ tuition), despite being in the best school district (Palo Alto School District).
Apparently public middle schools are really bad in California, but you can still find decent high and elementary schools
All top private middle schools in the bay are oversubscribed and cannot accomodate everyone, and require ridiculous exams and admission process that rivals Ivy League, situation is really bad, and demand for good teachers is infinite