I don't think that SF is better than NYC for the homeless.
A big difference between SF and NYC is that NYC provides shelter for people that can't afford housing and SF does not. Only 5% of homeless people in NYC are unsheltered compared with 67% in the Bay Area.
Legally, NYC is required to provide shelters for anyone who needs it, while SF shelters have waitlists of over a month.
https://medium.com/@josefow/new-york-decided-to-end-street-h...
https://www.sfgate.com/bayarea/article/Bay-Area-homeless-uns...
https://sfpublicpress.org/news/homelessness/navigation/2017-...