Technical debt is a problem
BUT - Agile does have a mechanism to deal with it - developer self-interest/autonomy.
In a happy-clappy-perfect-agile world, dev get a US for a sprint - but it's in an epic, that's tied to a feature, that's tied to maybe a nice wiki page explaining the business case.
Sure, they could bang out the minimum to hit the done critera - but the stuff outside the US exists for a purpose.
Read the context, see what's coming up next in the backlog - and 5% extra effort now, will make the next US 20% easier.
Prior to release, when the shit hits the fan, then yes shortcuts are taken. However under 'normal conditions' devolution of design is supposed to incentivize everybody to avoid debt for a more pleasant life in the next sprint.