Time and programming resources are finite in every project, and no one knows how to write perfect code. Requirements are never complete and unambiguous. We can’t know the future.
Calling a completely normal side-effect of professional software development “technical debt” as if it’s an aberration assumes we know how to do everything right, and have time to do that. We never do.