People like to think they didn't make a decision like: "I know this code is shit, but I'm going to push it live anyhow." But they DO. Every time. They just lie to themselves about it being shit.
I'm even going to argue that there IS a time and place for shitty code. Startups are a great example of this. Get some barely working code up and going (incur debt) and then fix or rewrite it (pay the debt off). This gets the business earning money and moving forward as quickly as possible, and there's time later (if you don't put off the debt too long) to clean things up.
The problem is that it doesn't have a $ amount attached to it, so many business types can't see it. They just see a working system and can't imagine why you want to spend more time and money on it. (Not that I really blame them... They can't see it.)