The response from many, many California businesses is to just close their bathrooms to the public. This means fewer places for homeless people to use the bathroom. This causes homeless people to go to the fewer and fewer available bathrooms. Since homeless people often smell, and may make a mess in the bathroom, without necessarily buying anything, the increased traffic to the remaining bathrooms causes even more bathroom closures.
Combine this with the SFPD's non enforcement of public urination and defecation laws, and general non enforcement of minor crimes, particularly if the perpetrator is homeless, it's inevitable that you will have poop all over the sidewalk.
We need more bathrooms, and we need to start enforcing the law against homeless people. If there is a reasonable place to use the bathroom, and not using it will get you arrested, the problem will go away.
Next up is getting the drugs out of the SF city jail. Many ex-addicts say that they got clean when they hit rock bottom, got arrested, and had no choice but to kick in jail. In SF though, you can get drugs in jail, so one of the only positive things about going to jail is eliminated.