But it probably goes: SF spends a lot of money on services for the homeless, so lots of homeless people keep going there to get those services. Other places don't spend any money on services for the homeless, so the homeless people leave.
If every place spent a little bit on services for the homeless, there would be just a few homeless everywhere instead of lots of homeless in a few places and no homeless in other places. But that would require coordination to ensure nobody free-rides and just lets other places take on the homeless.
$300 million is a lot though. I've worked on construction projects building ~250 unit apartment buildings that had budgets of $25 million. It seems like you could just build actual housing for most of the homeless with that kind of budget. (Of course that would require SF to allow housing to be built).