Adults are killed by homeless people in SF. They are an irrational danger that is difficult to prepare for. There are also a lot of them. It's one thing to say if you see a homeless person stay away but it's another when there are dozens of them camped on the sidewalk. Telling my kids to instead walk in the road is not a great option either.
You are not wrong and 99% of the time doing as you suggest is valid. Hordes of crazy people are a danger of a different breed.
And historically, society would drive insane and homeless people out of nice areas. Middle and upper middle class people weren't letting their kids hang out with drifters in the past.
We left because my wife was terrified to be alone outside of our apartment. She would be followed, harassed, threatened. Because we saw crimes occur in broad daylight and experienced the indifference of police when we called.
Comparing the environmental danger of avoiding snakes and not diving into water where you can't see the bottom to navigating the streets of San Francisco as a small, alone human is ludicrous.
In rural environments, that can include wildlife dangers and natural hazards and in urban environments, it can include human dangers and industrial/sanitary hazards.
Environmental danger is not new. The culture of isolating kids rather than educating them is. Whether the new strategy is better for the kids is an open question, but seems crazy to some of us.