This is a man who made his work out of his hobby. He likes keys, so he makes keys. The only trouble is that he starts of with a key, and then has to go out and find the proper lock. He tries his keys on big empty houses, because he is looking for a place to move. He is sick and tired of his cosy, crawny, little shop in the market and he is looking for some space, preferably with some big windows and open rooms.
So now he wanders around town and tries his keys on every lock he can find. When he is lucky, he can sell the key to the owner of the lock. If the owner doesn't buy the key, the locksmith is free to take whatever it was the lock was guarding (see the law on keys and locks)