Not sure how you define idiot, but more often than not pm's have no formal programming experience which makes it difficult (though not impossible) to understand the value of well-engineered code. The only language they speak is dates, which unfortunately is usually accompanied by loads of unnecessary documentation.
Code that was well-engineered 3 months ago may suddenly become lacking in light of a client having a brilliant new idea/requirement.
And a programmer is not always in charge of his estimates. He may have to arrive at it together with his team lead who is under pressure from 2-3 project managers, thus only the minimal reasonable time will be allocated, without concern for architecture changes or refactoring.
Yeah, but in my experience, the PM's response to that will be "can we get it done sooner?"
If the estimated time aligns with what they want, then you're fine. But that's rarely the case and when things slip the code cleanup is pushed to the back burner.
Obviously not true, unless your project manager is a complete idiot.