I've been in areas of Manhattan that would rival SF's dirtiest areas, but I wouldn't claim that NYC is a "dirty city".
I'm more worried about the threat of violence from mentally-unstable people on SF's streets, though that's something that's also concentrated in a relatively small number of places (unsurprisingly often coinciding with the dirtiness).
I've lived here my entire life, and I would :-)
As much as I'm a booster for NYC (and immensely proud of our public transit), we're also a very dirty city (partially for historical planning reasons, resulting in no alleyways or trash disposal consideration).
It's also gotten worse during the pandemic, in no small part thanks to drivers: people have stopped moving their cars for street cleaning, resulting in accumulations of trash and dirt that then clog the drains, worsening our floods (and damaging the subways further).
NYC is a filthy city. I think most people that live here and love it would agree.
I will admit that, by American standards, SF has pretty good public transit though.
I am not coming from a perspective of pro-law & order, just a commentary on drug law & enforcement here.
Spending for homeless is 61,000 per person