It's not San Francisco's responsibility to pick up the slack for places that don't take care of their homeless. Declaring that it is doesn't make it so, and both creates perverse incentives (for other places to shirk on their responsibilities) and makes it impossible for San Francisco to fulfill its own responsibilities.
Also, I don't think I used the word "deserving," despite your quotes. They deserve help, but San Francisco is not obligated to be the provider of services for the entire country. Once we do manage to build successful programs for the homeless who originate here, then we can talk about whether it makes sense to build aid systems and SF housing for people from other communities.
As it stands, we fail all the homeless in San Francisco. It's silly to think we can tackle homelessness nationwide before we even can get a handle on those who come from here.
This is how the system already works. The Homeward Bound program provides free bus tickets to people who have a support system elsewhere. That still leaves a substantial population of people who do not have any other support system, or whose support system is in San Francisco.
> If nothing else, people with longstanding ties to the community and economy should get preference for services compared those who didn't.
This is how the provision of services currently works. The problem is not prioritization, the problem is a lack of available housing for even your narrowly-defined “deserving” unhoused people. And arguing about a few percent being moved into a different category of eligibility does nothing to fix the underlying problem.