It's probably cheaper than locking them up or destroying property and littering.
I don't think it stops those things, I've posted before about travellers who camped illegally on a friend's land and left a disgusting mess. There were so called sites they could go to about 40 miles away and its not as if they don't have transport.
Giving them a free place to live really means huge disruption and a rise in crime for people who live in the area and a drain on the tax payer. And they would still commit crime and be locked up.