I think we try too hard to generate software factory workers instead of competent craftsmen.
We create people who can assemble big blocks they don't understand in certain standard ways to solve certain common problems, not people with a deep understanding of their tools and how to solve new problems and create new tools.
This is described well at https://wiki.c2.com/?PlugCompatibleInterchangeableEngineers
And the prioritization of sticking to some made-up schedule and shipping "on time" over software quality has created a proliferation of bugs at every level of the stack.
In the days before the internet was widely available, shipping software on physical media, such as a ROM cartridge, floppy disk, or optical disk, automatically created an incentive for the developers to get the software as correct as possible the first time, because distributing updates was slow and unreliable. Bugs were less common than they are today, and they generally had a smaller impact on the user.
The mad rush to ship now and fix later, which comes from the illusion that fixing it later is cheaper because we can just require the user to be connected to the internet and installing updates all the time, leads to code being written more quickly without understanding or planning, and shipped while still error prone and unreliable.
Furthermore, as anyone can tell you who has run older operating systems or programs on modern hardware, we have on average gained small amounts of functionality over the years while the software has become drastically slower and buggier.
I suspect that the only way to solve this in the long term is to push for a broad societal migration towards Free Software. Free Software authors seem to take more time getting their code as correct as possible before they make an official release. In fact, it's common for them to spend years getting to their 1.0 release, upon which they stake their reputations. On the other hand, 1.0 releases of proprietary software are sometimes broken to the point of being unusable.
However, using Free Software will not, by itself, solve the problem. It has its own issues with bloat and complexity over time, but Free Software authors seem, on average, to do a better job of taking the time necessary to pay down technical debt and perform necessary refactoring, so for the moment it seems like our best hope.