I have hook and eye locks on all the doors from when dd was a toddler so I could control where she went in the house, her bedroom used to be my study.
They are also useful for stopping the cats and dog for roaming the house.
They also mean that if a burglar gets into one of our rooms through a window his movement may be limited and he will have to make some noise to get out of the room.
I have never locked anyone in a room, actually that is not true when I am not well and need to rest dp will lock me in a room to dd and any kids she has around cannot disturb me.