I don't recall a book per se, although I read a number of them in the 90's (Code Complete, Pragmatic Programmer, ...). In my case, practice and the necessity of maintaining code led/forced/encouraged me to get better at writing code that was clear and (eventually) more robust. They might write about this, but until you're standing in that swamp watching the alligators approach that you are properly incentivized to get better.
But remember from The Soul of a New Machine, "Not everything worth doing is worth doing well. Everything not worth doing is not worth doing well..."
I'd concur with this - it takes having to deal with your own mess to understand that a lot of times it's better to slow down and get things correct up front.
But remember from The Soul of a New Machine, "Not everything worth doing is worth doing well. Everything not worth doing is not worth doing well..."