You know that thing your players do to stuff but its alright because the stuff was evil? Yah that, quite an interesting thing when you think about it. In a dungeon its fine and really tends to be more of a self defense type of thing seeing as the monsters where trying to kill you. What happens though if you do it in the city?
If they kill someone in town this should mean something. Even if it was an evil person who was trying to destroy the town or something, in general your still supposed to bring them to justice. I talked about this some with bad guys because a good villain should follow the laws in his home if he can help it. The constable won't care if he was terrorizing your town if you don't have proof it was him. Laws help the general populace keep order but with a hero they can restrict you from doing your job. Think of all those comic book villains who keep killing people but the heroes have to keep arresting them instead of a more permanent solution.
In D&D the players in general wont stand for this even if they are lawful good. Part the fun in the game is the killing of stuff and looting whats left over. They won't think of arresting a monster or villain unless specifically told to by whoever wanted it done. This works alright any where but in a town. It is a good idea if you want to be hard on them for killing the enemy when in town make sure to warn them of this because even though it seems like common sense, well I have found that "common" sense tends not to be.
My final thoughts on this is that if you want players to not kill villains give them an easy way to do so. This means making sure they can knock opponents unconscious during combat. It could be the by the book way or simply letting them have the option to knock a person out instead of killing when the players beat them. In the end if they don't know how to, you end up with them killing the person and skipping town instead of dealing with it and all that does is make them cross a town off the list of places to go to.