Councils spend £50m opposing development of new homes