I feel the same, when I travel to other larger cities (Portland, Seattle, Minneapolis, Chicago, LA, Atlanta, etc) there are similar problems. It’s not an SF problem it’s a city problem, especially the more “downtown’s” it gets as opposed to more “neighborhood’y”.
Cities have plenty of problems, but by and large they are not a particular danger to children.
I generally feel significantly safer in cities with relatively walkable sidewalks, relatively narrow streets, and lots of pedestrian/bike traffic than I do in typical American suburbs full of strip malls and 6-lane roads. The latter are in my opinion horrendous places to raise children.