Public education is good in the areas where the upper middle class live.
Old Greenwich, Cos Cob, and Riverside have great public schools because that's where all the IT professionals, quants, and middle managers move to raise their families. Those districts have access to many adults with an interest and ability to participate in the school community, and so the district ends up with a lot of extra resources.
But the hedge fund upper management send their kids to Brunswick School, Sacred Heart, and the like, and the district on the super rich and the poorer, primarily-Hispanic sides of town, has a poorer reputation.