Cities like SF tend to be okay for families in two different (and polar opposite) classes - those who are working poor, and the scare factor of public transit and hassle of traffic is something they just have to deal with, or quite wealthy - and they can afford drivers and/or private schools.
The public school system in SF is also notoriously terrible to deal with, even by US big city standards, as ‘equity’ changes results in bussing kids all over town so there are no ‘good’/‘bad’ schools due to demographics. So siblings will often end up in schools on different sides of town, or kids in a school very far from where they live.
The middle class tends to go to the suburbs where things are less crazy and easier to handle, and they get ‘bad’ things like a school where all the neighbors kids also go, and siblings can all be in the same school. And they can buy into a ‘good school district’. Among other things.