Should not be an issue in Europe. Usually homeless people have other options than sleeping in public transport here.
Maybe good by Eastern European standards.
So you see them riding the BART in San Francisco, making a nuisance of themselves, while also, the city spends a ton of money and has homeless shelters.
Also, the basic ability of police to hassle people is less.
Only 1% of Scotland's homeless were intentionally homeless, and 4% reported sleeping rough the previous night -- a total of 690 across Scotland. Which is still 690 too many.
And yes, it's not free of charge to the public purse, but it's significantly cheaper than not providing support and then needing to deal with the consequences.