Locking is a way to preserve people's posts yet stop a topic gone bad. Many people would be upset if a long thread was deleted. And sometimes deleting single posts within a topic causes confusion for the thread's linear progression.
Let's consider when someone writes 5 paragraphs opposing an idea. Or even worse many long posts. If we delete the entire topic, he may be so frustrated, he won't want to post again. If we were to delete the post(s) he responded to, its still time wasted on his part because no one else will understand his point or what he was referring to. This person did nothing wrong, he just wrote in a thread that was becoming hostile or disturbing other members. In this case, we would lock it. The topic is still there to be viewed, it can be found in a search, but it cannot continue any further, and it will "die" (become buried by new threads).
If a topic is inappropriate to begin with, a moderate should delete. If the topic is interrupted by an inappropriate post (or spam), then we delete the post itself and leave the rest untouched.
Now granted, some moderators make better judgement calls than others based off of their experience, and how much time they have free to correct the problem.
I personally administrated a video game developer's official game board for many years, hosted events, and helped players to troubleshoot game performance issues, therefore my ways are going to be on a professional level. If I have a problem with someone's behavior or posts and act, they will know I did it, exactly what I did, and why. Mods don't have to do this, but I like to. It also works as a record for my actions so there is no question about them, nor lies spread concerning them.
By the way, hi! I'm a moderator now. =)