Could you please provide some links to those figures? The last figures about homelessness in Berlin I know were below 2000 individuals [1], which does not strike me as shockingly high. But things might have changed.
[1]: https://de.statista.com/statistik/daten/studie/1097522/umfra...
Amsterdam has basically the same population as San Francisco (~820K) but 10K homeless people as opposed to 7K.
Berlin is of course much larger (3.6m), but is literally called "the capital of homelessness" in NGO circles because the homeless population is so absurdly large, 10K rough sleepers (which is the only population the city bothers to count) and another 30K homeless by the US definition.
I live in Berlin and this is highly misleading. Amsterdam and Berlin are major drug centers and people move specifically for the supply and public services. Half of the Berlin homeless are from Eastern Europe and moved here for this reason. Other areas make up most of the rest. The number of homeless Germans in Berlin is very low. This has been widely reported and confirmed by recent census and interviews. The expenditures also include refugee (unplaced or unhoused) spending for people from Ukraine, Syria, and many other areas. Here are the real numbers: https://www-genesis.destatis.de/genesis/online?operation=abr...
The denominator becomes tricky too, in that SFO has an estimated given-night homeless population of about 8000, about half of whom are rough sleepers (people literally camped out on the street/under bridges). Note that this is a high proportion of rough sleepers compared to most cities where it's about a quarter of the homeless population. That translates into about 32000 people experiencing homelessness at some point in a given year (at least that's the rule of thumb I remember from -- wait for it -- working at a homelessness NGO years ago). So the most naive calculation shakes out to $850m spent on 32000 people, or just north of $27K.
Obviously this has some problems, in that at least some of the homelessness prevention money is hopefully preventing a non-zero number of people from becoming homeless (though in my more cynical moments I wonder). But then again somebody who's only homeless for a month shouldn't need a full year's spending.
TL;DR: it's complicated and there's not a single answer everybody agrees on, but in terms of orders of magnitude it's "tens of thousands of dollars per person per year" in most large US cities, with SF as an outlier on the high end.
(If you really want to get depressed, look at European cities like Amsterdam or Berlin which have homelessness rates approaching double most US cities' and even higher expenditures.)