I saw this as a safety thing. They want to lock the doors to the house at night to feel safe while they're sleeping. They're not locking this person in a room they just don't want someone who is going to leave or come in after midnight.