Originally Posted by
TVTropes on Lawful Good/Discworld
As a prime example of how Character Alignment is only part of character, rather than the whole of it, Samuel Vimes is also Lawful Good, albeit of a very different sort than Carrot's. Despite being arguably the most cynical and misanthropic {deleted} in the series, Samuel Vimes is also one of the most moral. The law is the rock to which Vimes clings in a world that makes no sense to him — when a million-year old supernatural thing of vengeance possessed him, he kicked it out of his mind by creating the Guarding Dark, an entity of pure Heroic Willpower and Lawful Good. He does things by the book (well, mostly) and gives people their due process.
And when he does "bend" (or ignore) the law, it's because he believes the point of the law is to protect people, even in situations allowed by current law: Snuff has him arrest someone involved in enslaving goblins, despite the fact that the law doesn't consider them legally equal to most other races on the Disc, because they're people in his mind. Vetinari has the slaver marked to be assassinated, but that's because one goblin proved to be an amazing musician; otherwise he wouldn't have cared, and would have let Vimes deal with the political fallout. This is partially why Vimes is Lawful Good...