San Francisco is a strange place, where the only places you're allowed to be poor are in the tenderloin, 6th and market, or the projects. It's the only place I've lived where I regularly had to dodge human excrement on the sidewalks, car windows are all smashed, deodorant is locked down in the stores etc.
The poor don't consider themselves of the same people as the rich. The infrastructure is not for the poor, the police are not for the poor, the parks and sidewalks and houses and cars are not for the poor. Hell, while I lived there the poor weren't even allowed to sit or lie down! So why should they feel any civic pride or duty or identification at all? It's like some sort of Elysium and Deponia. The Elysians are so far removed from reality that crimes against them are hardly crimes at all as far as the poor are concerned. They'll never taste of the good things Elysium has, so why even care? Better to just grab whatever you can from them and try to eke out whatever existence you're able to. It's similar in many ways to the bandit camps and highwaymen of the Roman era.
I've traveled and lived in many places, and this sort of behavior only happens when there's massive inequality, tempered a small amount by the severity of the law.
I know this will get downvoted to hell because almost everyone on HN is rich, so they're blind to this. For you, the answer is better policing and stronger laws, because those are the only things that can help keep you separated from the rest unless you're rich enough to afford private security.