Typical way that competent developers end up with technical debt:
1. Customer/user/consumer has a vague idea of what they need but doesn't know how to express it.
2. Developer works with customer to learn their business and understand their requirements.
3. Developer throws together a prototype to confirm that he understands the problem.
4. Customer sees that developer is on the right track. If these 9 enhancements are done, then we'll really have something.
5. Developer quickly adds 9 enhancements to prototype.
6. Customer loves it! Move it to production so we can play with it for a while.
7. While customer plays with it, developer maps out a plan to architect, refactor, and scale the prototype to be "production worthy".
8. Developer is pulled away to 5 other urgent projects.
9. Customer continues to use prototype as production software.
10. Two years later: "Who wrote this crap?"