Personally, I'm prone to taking on technical debt when under time pressure or feature pressure. I think of it like my house: if I'm too busy, I get sloppy and leave messes. If I stay busy for too long, the messes stack up.
One complicating factor, though, is the age of the code base is a factor, too. Keeping up with new runtimes, new frameworks, and new ways of doing thing takes time. This is especially a problem with things built in the new hotness, because there the culture is one of rapid iteration. So if we really want side projects to last, I think we have to choose boring technology: http://mcfunley.com/choose-boring-technology
The trick is to avoid overstretching yourself in terms of what you promise - or to recruit a team. In this case, neither happened, and so the result was unfortunately inevitable.
Rewriting software is somewhat of an inevitability it seems like, but the more small reusable pieces you have, the easier that is. Think UNIX philosophy: small units that do a small amount of things well that you can generally depend on once they become stable.
It varies depending on your project of course. A lot of the tech debt you take on (fun new tech, getting something out fast) is half the fun.
This is exactly how my own long-term projects that actually have users have panned out. When everything is left to your own energy and charity yet it doesn't pay the bills, when there's work to be done then the project is lucky to get whatever you can spare.
And it typically needs work in spite of what's going on in your personal life. I was at the beach when my hand-coded forum went down (btw, don't build your own forum). I ended up patching it live on the server, guessed at the problem, and had to clean up my mess weeks later.
If you don't actually have users, then sure, that's something entirely different. I have plenty of projects that never left localhost with no technical debt, too. That's trivial.
It's a testament to Graham's productivity that he was able to keep maintaining it for so long in spite of those disadvantages, and says very little about perl.