Glasgow, the country's biggest local authority, ran up a bill of £2.5m.
Lack of suitable housing has forced councils to find an alternative solution.
Glasgow City Mission chief executive Grant Campbell said: "Homelessness is a scandal in any society and particularly so in a nation of significant wealth.
"Glasgow's struggle to combat homelessness is well documented and a shortage of accommodation has only made things worse.
"There is a sense of optimism the city council is seeking to take the appropriate steps to improve the system."