Often it's the opposite.
They did something in an horrible way knowing it was horrible but because they have been asked to deliver a feature as soon as possible and at any cost.
This is a slippery slope. It lets a company move faster till it reaches the point that the software becomes an unmaintainable pile of hacks.