The trouble is that systems these days are so incredibly complex, and have so many
dependencies. They are certainly full of flaws (mostly unintentional, maybe some
covertly added). There's no way to eliminate them, but plenty of bad actors looking for them and exploiting them.
When I started with 8-bit computers in the late 1970's / early 1980's, the OS was a few kilobytes of ROM and you could understand the whole thing top to bottom. These days, even a "hello world" binary typically takes 1MB+, and an OS is 10GB+
On top of this, you add BIOS software, FPGAs and custom silicon in high-end routing equipment, the management backdoors intentionally installed in CPUs by the likes of Intel, and cache timing attacks.