An iconic hotel in midtown Manhattan that has been serving as a shelter for immigrants is expected to end its role.