The government says it is working to close hotels used to house people waiting for their asylum claims to be processed, at a cost of millions of pounds.