It certainly could have, but the software industry optimized around speed and cost, and not around correctness. There was a hiring fervor for programmers with no formal training, and a complete lack of concern for anything but the bottom line. and now the chickens are coming home to roost.
I can certainly see a lot of challenges, but what are you thinking? The economic costs? The social aspect of security - 'safety regulations (must be) written in blood'?