Inspiration.
Cleaning bad code and/or fixing errors is actually one of the things I like the most about software development. It's the easiest thing to do and one of the most educating, specially if it's one's own bad code and/or errors that one's fixing.
That said, like all good things, it's better in moderation. If I were doing it all day I'd go crazy.