Upvote:5
In general, it is not illegal. Otherwise hotel workers, pizza delivery people, and many others would be in violation of the law.
If a hotel wants to control access to floors they can take other actions:
However, it seems if you go to a hotel where President Trump is staying, then you are subject to arrest if for some reason the Secret Service does not like you.