That's only because SF isn't safe, esp relative to rent price. I regularly walk alone at 2:30am in nyc in most neighborhoods.
As we heard all day yesterday, nyc has the most massive and powerful police force in the world, which is understandable since it is a target of terrorists. It also takes an awful lot of money to live there. Must be nice. I dream of living there myself one day, but my time and money have run out.
SF rent is pretty equivalent?
And note that SF spends $604 on policing per resident, vs NYC's $626 on policing per resident
A lot of it is about how many people are around (and how you fit in). I have no problem walking in many areas of Manhattan late at night though try to stick to busier streets and avenues.