What about when management (and financial realities) pushes relentlessly for new options, customizations and deployments? When all time not spent shipping new variants is spent developing features? What then? When is the code going to be refactored? In the developers' spare time?
What about it? Yes, that environment will obviously be less conducive to good code than otherwise. But bad coders will do (a lot!) worse than good coders.
Don't assume that all good code bases out there were written by teams with reasonable, well-defined and stable requirements, plenty of time and money and perfectly enlightened management. Very few projects are like that. Generally, I think you'll find they were written by good developers who kept their heads cool in the face of a range of challenges.
Absolutely, they will also largely not have had bosses that death marched them or changed requirements three times a day - as I said, management do obviously play a role.
Certainly not in spare time. It has to be part of the daily work. I compare it to running a restaurant. Cleaning up the kitchen every night takes time but it has to be done no matter the circumstances. You can't skip it or the health department will come after you. Unfortunately in programming you can get away with taking shortcuts for a long time.
Incidentally, good cooks are extremely tidy, they clean obsessively as they go - and they are under insane pressure, and don't wait for management to allocate time for cleaning.
They clean continously, not primarily to make the end-of-shift cleaning easier, but because it allows them to execute faster, better and more consistently (which in that environment is a necessary condition for executing at all).