Councils spend £1.7bn on temporary accommodation amid homelessness 'crisis'