Two barracks in Scotland and England will be used to accommodate around 900 asylum seekers as the UK Government ends the use of hotels for refugees.