Oh, in hotels it's even easier, since it's not "keys" but keycards that are programmed, and the desk just has to punch in the wrong room number (or the computer has an issue that allows double booking).
Fun fact I found out a few years ago when I was visiting NYC when they had their blackout: Hotel keycard locks work even when the electricity's out, but of course they can't be reprogrammed, so people could theoretically get into a room after they were supposed to have access that way.