Two men were told they could not stay in their rooms at a city centre hotel after being identified as homeless.