To wildly speculate, NYC is much more walkable and has better public transit than SF. This puts the people more in touch with each other and increases the feeling of community, and also makes it harder to smash a car window when no one is looking.
Or maybe NYC is just bigger and the crime happens further away from where you personally live? The feeling of safety is so subjective.