Much of the code being dealt with by Toyota (at least that subject to the lawsuit and so made available for analysis) was embedded code which is a bit more amenable to very deliberate design, testing, and verification. NASA, for instance, has a long history of producing extremely reliable software, even proving the software correct at times. Would any private corporation in the world ever resort to following such a practice? Never. It would quadruple their software spending and, maybe worse, they would have to listen to their engineers. When the business wants to ship a project, if the engineer says 'its not ready yet', if its a bridge and they go ahead someone in a suit goes to prison. If it involves software, everyone goes home happy except the dead customers.
Embedded software can be spec most of the time and it should be.
Software however is all but impossible to spec from the beginning, or perhaps ever at all... so with only working with the smaller details, the larger picture is lost. At any time, any team, is instructed to stop a problem and immediately fix it, it's band-aids on top of band-aids.
Having multiple teams working on overlapping projects, with little communication leads to the spaghetti code that was mentioned.