In the book Clean Code: A Handbook of Agile Software Craftsmanship by Robert C Martin he advises that you should follow The Boy Scout Rule when maintaining code. The idea is simply to leave the code a little cleaner than you found it. I.e. it is very similar to the tip about not leaving broken windows from the Pragmatic Programmer book.
I've found that I tend to do this more and more often, but I also see many fellow developers who subscribe to the "if it's not broken, you shouldn't mess with it" idea.
I'm aware that this may be somewhat of a religious debate with no single answer, but I am curious to know what point of view other subscribe to as well the reasons for doing so.
In other words: Do you clean code as you pass it or only when you have to fix the code anyway?
EDIT Related question.