Should hotels have a right to search your stuff?

My husband and I often go to this casino about a hour from our home we always get a hotel room and spend the night. They have a security guard by the elevators that take you to the hotel rooms who you show your hotel key to so you can get to the rooms which I think is great.

So on our last visit as we were checking in with all our stuff (suitcases and ice chest) the security guard asked to look in our ice chest we said ok.

He opened it and we had some waters and beer. They do sell alcohol at the casino the beers are $9 each so we always bring our own and have a couple in the hotel room.

He told us we can’t bring our own beer into there hotel rooms and we have to buy it at the casino. ( also we were paying $300 a night to stay here)

I felt like this rule is unfair and just a way to make more money and we obviously weren’t going to pay $9 a beer.

We were spending $300 a night ($600 total since we were staying 2 night) and going to spend a lot in there casino as well.

I honestly don’t think they have a right to even look at our personal belongings unless they have a good reason. What’s your option hotels searching your stuff and not allowing you to bring alcohol into their hotel rooms?