While it has not happened to me while a guest in my room, I have on more than one occasion, and at more than one hotel brand, been issued keys to an occupied room.
I bet it happens more often than people realize.
It is a good idea to lock your door and use a secondary lock while in your room!