We've absolutely mastered these systems.
We just prioritize rapid development time and ease of use over security.
People make fun of DoD / space price tags (and admittedly, there's still a lot of crap sold there), but it's a trade off.
If we wanted computers to cost $x0,000 and OSes to cost $x,000, and the pace of progress to be glacial, we could have completely secure systems today.
It's a choice, not an impossibility.