I think talking about "technical debt" is misleading: it makes people think about tech debt they are creating, which is not really the root of the problem.
The thing is, code requires constant maintenance. Standards evolve, underlying libraries and languages change, expectations shift; what was considered cutting edge 10 years ago is confusing and archaic today. Keeping a codebase modern is a constant effort, even if it originally wasn't written in a tech-debt-inducing way. So it's less like debt and more like infrastructure maintenance (think roads, buildings etc): you can either continuously make small upgrades, or wait until the whole thing has decayed to the point of uselessness, at which point fixing will be much more expensive (maybe prohibitively so).
That's the central issue with MediaWiki IMO, that those constant updates aren't really happening. RfCs are not consistently implemented, there are shifts in how we think about the architecture but they never get fully implemented (like the API/DerivativeRequest issue where everyone agrees how our API code should look and then things are left at that). There is no social contract on who should do that kind of maintenance: the people who use the code to build features with it, or some dedicated group (that currently doesn't really exist). Tech debt (in the sense of people cutting corners intentionally) is sometimes a problem, but it's not the main problem.