1. Fundamental complexity of the functional domain
2. Limit or incompetence of developers
3. Human nature of short term gain and not willing to do the right thing /invest for long term gain, this is not just development side, but from management down.
by the way, ultimately it is not a bug free system that wins, rather it is the ones that are on the market that are good enough for customers to pay. And market opportunity could be there just for a short period such as trading model case so the code will be obsolete soon anyway.