as long as people wish governing powers to include that ability, that's the way. you find that most (all?) jurisdictions include provisions to remove people from public spaces.
State democracy and capitalism. Local electorates are primarily wealthier people with time on their hands, so they overwhelmingly prioritize fighting crime and promoting local commerce, which are efforts that homeless populations are seen as undermining. The result is that punishing homelessness gets politicians re-elected.