I think the key system is a different system to the door locking system. The door locking I think was a way to try and solve the problem of random sims walking in, and controlling which sims could go in different rooms.
The key system came with City Living I think, where sims would just let themselves in to hang out rather than knocking on the door and waiting for sims to invite them in. I like to think of it as family and close friends making themselves at home but they tend to do it A LOT.
Mainly, it's just a way to meet the requirements for the location based aspiration, and I don't really use any of the locking systems - like you say, they cause more problems than they're worth in my opinion!!