You think these people prefer to shit in public?
Lots of them are sick (mentally and physically) and drugs and alcohol can make one lose control of one's bowels or bladder.
When you have to go you have to go, and there are very few public toilets in SF, and many businesses just won't let homeless people or people who look poor use their bathrooms, especially not in places where there's a large homeless population, like the Tenderloin.
So where are these people supposed to go?
If SF residents really wanted to do something effective about all the shit and piss in the streets they'd build many, many more public bathrooms and lift people out of poverty. But they don't.
Yes I do. Shitting in a plastic bag is available to everyone. Peeing in privacy behind a dumpster is available to everyone. Taking any half assed steps towards public hygiene is available to everyone. I've seen a homeless drug addict stick the water fountain bubbler into his bunghole while he was washing his ass with it.
The same reason they aren't shitting into bags and throwing them in the trash, or peeing into storm drains, is the same reason they're homeless - addiction makes people into sociopaths.
Solve the most impactful problems first.
Obviously stealing cats or being a porch pirate is a better ROI with the side benefit that you get to be your own boss. But junkies don't do these things to anywhere near the same extent in other parts of the country because they can't get away with them to the same extent. Addiction is a powerful motivator. If stealing stuff to get your fix is likely to result in withdrawal in a holding cell people will find the next best way to get their fix.
People with severe mental health issues have trouble holding down jobs, so I'd be very surprised if the people the original article talks about who are running around screaming at invisible demons could manage to work installing roofing or doing anything else.
These people need help, not prisons.
So I hope you and people like you never move to where I live.