A £2m purchase of new-build properties to help house homeless families in Scarborough has been approved by the council.