There are not really any uses for locking things, AFAIK. NPCs don't steal stuff lying out in the open, but if you really wanted to you could lock your house (if you take over or buy one) to keep people from wandering in.