Yea, other locations might have some good draws like schools or a lack of fog. Yes, SF might have more LGBTQ folk. Neither of those are going to be a good explanation for the exodus.
Ultimately, I'm not sure cities see this as a problem that needs solving (regardless of what public officials might say to a reporter). I live in a similarly expensive city. Schools are expensive and I have no kids so that's a win for the city. I have high income and can bid up property values which is a win for the city. The city is building a lot of office space which pays very high property taxes while using comparatively few city resources (compared to residential). The abundance of jobs drives property values even higher which drives tax revenue to the city. Why would a city actually want kids?
I think a big driver of this in SF is that the software industry skews young. Software is a relatively new field unlike, say, medicine where you'll find a broader range of ages because computers have become a much bigger part of life more recently. Software can also be concentrated in certain cities in a way that doctors are going to be spread out a lot more. So, SF has an army of young, childless software engineers with more money than they know what to do with who might not have reached an age where they're thinking about saving willing to replace anyone looking to have kids who might move out.
So SF has no incentive to make it a better place for kids. If you want kids, leave and the city will replace you with a young childless person who can plunge their money into the city rather than asking for city services.
I think it's gone on too long to really course correct at this point. If you try to take steps to deal with housing prices, you're going to get a lot of opposition from your voters who have bought property in the city (and sunk their life savings into it). If I've paid $1M for a condo in SF, I don't want the city embarking on a big new plan to double the amount of housing. If anything, I want the opposite.
It's an unfortunate circumstance that wasn't addressed soon enough.