It happened to me twice, in many years, both times in York! And that was because when I arrived it was key-carded and I had to go to the door at first floor to greet them at the top of the staircase. It was tucked out the way but there was CCTV in the hallways. It was the last day I was there and the shift manager came to the door and said I had been seen taken more than handful of men into my room from the stairs. I played ignorant for a bit but gave up quickly and said I'd leave. It was the last night so I didn't ask for a refund or anything and I only had one more booking due in. I was tired and not in the mood to travel home late evening, but it wasn't the end of the world. The manager wasn't rude, a bit embarrassed if anything.
The second time was an AirBnB, and it was after I left. I didn't realise there were cameras on the doorbell (lax of me) and I got booted off the site. That bothered me more but just because the owner of the property was unnessearily offensive, calling me disgusting and telling me that I should be ashamed of myself for selling myself etc.
I'd assume that it would be technically illegal of hotels to knowingly allow prostitution to go on under their roof so they'd have a legal right to to oust us, so if you do get caught, I think its best just to cut your loses and leave quietly.