For any non-trivial software project, spending time on code quality and a good architecture is worth the effort. Every hour I spend on that saves me two hours when I have to fix bugs or implement new features.
Years ago I had to review code from a different team and it was an absolute mess. They (and our boss) defended it with "That way they can get it done faster. We can clean up after the initial release". Guess what, that initial release took over three years instead of the planned six months.
What they did was far beyond "agile". They didn't care for naming conventions, documentation, not committing commented-out code, using existing solutions (both in-house and third-party) instead of reinventing the wheel...
In that first review I had literally hundreds of comments that each on their own would be a reason to reject the pull request.