Security in hotels isn’t as safe as you think.
Most times after you check out the key cards do not expire, so if the person who was in the room before you decides to come back, they could get in.