edit: I lived in SF & Oakland from 2013-2019 and Manhattan from late 2019 - now.
The feces problem in SF is exacerbated by opiates. Heavy opiate use causes extreme constipation and opiate withdrawal causes the opposite. Housing and drugs are the top of funnel problems in SF contributing to everything else. New York City seems to not have anywhere near the level of public feces as SOMA / Downtown SF even throughout the pandemic.