I never considered locking either of my children in their rooms at night. Then again, they weren't wanderers. They slept pretty well.
Even if you lock the door, you don't know what kind of trouble a tired, scared, bored toddler can get into in their own room!! I would keep a monitor on, just incase. I like the baby gate idea a lot better.
When my son was about 2 he climbed out of his crib a couple of times, once landing on his head, so we put him in a toddler bed. He got up in the middle of the night once, which was rare. I heard him get up. Then it got quiet. My instinct kicked in...it was unusual for him to get up. I didn't hear the front door open, but I still knew something wasn't right. Sure enough, he wasn't in his bed. I panicked and started looking around (luckily we lived in a small apartment at the time, so it didn't take long to find him). He fell asleep behind the couch. There was about a 1-2 foot gap between the couch and the sliding glass door. He must have been sleep walking.