This is something those wishing to build higher quality software often forget: business mostly care about return on investment.
As software engineers, it's our job to find exactly the right balance of quality and speed, and strategies to increase quality with no detriment to speed, for what is usually asked of software engineers.
Just like bridge and building engineers do not design those structures to stand up to 1000x the forces that they expect those structures will experience, software engineers need to learn to build with just the right level of complexity to quickly provide quality solution to a business need.
And that's where software engineers really struggle, and agile helps keep that in check, but in practice does not really improve quality. Software engineers should come up with ways to achieve quality with limited resources (just like engineers do everywhere else), and the best teams I worked in or with have!