Ideally they shouldn’t be needed. The only individuals who should be homeless are those few who are afflicted with chronic wanderlust and actually prefer living rough, and for them there should be bothies (or urban equivalent) available so they can take shelter when the weather is rough. For example the German city of Ulm has put up these sleep pods

each of which has a mattress, a power point for recharging phones, and enough space for up to two people to sleep safe from the weather. The pods signal back to base that they’ve been used, and somebody comes out during the day to check them and clean them if necessary.
If you have enough homeless people to form an encampment, then you know where they are and can put up chalet-style micro-houses so they have somewhere dry to sleep and a lockable place to store their stuff, and if you paint and decorate them nicely they’ll be an urban feature, not a bug.

Grow some nice climbing plants up the railings to soften the outline and it will be a pretty sight that tourists want to photograph, not a sign of urban blight. Build enough and not just homeless people but migrant workers, backpackers and students will be happy to use them.
It depends on the location.
Typically, people who are against homeless encampments are not so much against the encampment itself, but its location.
Like the homeless encampment that sprang up on Venice Beach. (I’m told it’s been cleared now.)

The argument was, “how come those guys get to just claim some of the best public space for their own personal use indefinitely?”
Here in Chicago, it’s common for a homeless person to just claim a bus shelter for themselves:

So if it’s raining, and you’re waiting for the bus there, sucks to be you.
It’s the same thing for public parks here:

Technically, the parks close at 11 every night. But the homeless people get to stay there. Is that justified?
No one really cares about homeless encampments that are in empty lots:

That’s not a public space and no one really wanted to go there anyway. That encampment is a problem for the owner of the lot and maybe the neighbors, not the general public.

We must first understand that the term “homeless” is in itself a very misleading term.
It effectively turns a societal flaw into a sympton.
At best, it is assumed that people end up without adequate shelter because of circumstances that are out of the hands of the State or anybody else who supports their policies, and at worst.
At worst, it is assumed that people choose this lifestyle the same way we choose our preferred haircut or dessert.
The reality is that people are not homeless, but are in fact the victims of homelessness.
It is amazing that whenever the stock market crashes — usually because of something that was decided by those higher up the economic ladder — it is those at the bottom who are always the first and last to experience its brunting effects.
Why it is that people become displaced from proper living varies from place to place and time to time, but the most common reason is because of a broken legal system involving a combination of bad zoning laws, out-of-control inflation, employment rights, and largely unchecked immigration among other factors.
With all that said, should people be allowed to set up tents in a public park if they have nowhere else to go?

Yes.
Until the same broken laws came about, nobody specifically “owned” the grounds on which a public park rests on.
And I would much rather see a public place with tents than a green cemetery.
If the State were able to provide adequate long-term shelter for those who find themselves resorting to sleeping inside a tent, we could then discuss matters then.
Our politicians whine about how it is “not fair” that they and their kids should have to see poor people when they are trying to “enjoy” themselves at a beach or park.
Well… I am certain that those who are living in tents would love to have a real home where they do not have to urinate and defecate in a bush, have proper means to buy and eat real food, and have secure doors and walls.
Ralph Waldo Emerson once defined the true strength of a country as such:
“The true test of civilization is not the census, nor the size of the cities, nor the crops – no, but the kind of man the country turns out.”

If the only thing our country can produce are self-observed people who believe that their summer afternoons at a park are more important than somebody else’s life or death situation, what does that say about the foundation of our society?
A building with a rotten structure will remain as such no more how much gold is plastered over it.
This is not to say that I believe that tent cities should remain unregulated.
In fact, I even encourage it.
If I was a person sleeping in a tent — where my entire world, including my few worldly possessions are located — I would want to sleep in a very orderly, clean, and safe environment.
I still think it is disgraceful that in this day and age we can spend billions if not trillions on warfare, yet are either unable or unwilling to provide basic housing, but if I had to choose between living in a “tent city” that was unregulated versus one that was supervised, I would choose the latter.
Supervised camps are more likely to be clean, be less rowdy, and be less likely to be robbed and attacked.
If the State is able to waste so much money incarcerating people for sleeping on a park bench, it is within their budget to manage an encampment without resorting to tearing them apart.
In conclusion, the most ideal type of encampment does not exist, because that should not be the end solution.
Though a homeless encampment that is secure and is protected from the hands of the State is definitely a large step in the right direction.
