Same experience here. Have a mod installed that closes doors after ten seconds. Was getting tired of seeing everything in my settlement open. Have noticed that some settlers would just open a door, wait for it to close, then walk back over to open it again... and repeat.
Also, as much as I like the idea of being able to lock doors, in my experience that wont keep NPCs out. I've got a player house setup that you pretty much need a jetpack to get into, but will still sometimes find settlers in there. I've also seen settlers push themselves against walls until they manage to glitch through them.