Unfortunately, the web became the only app platform that was perceived as being politically neutral, and so there was huge pressure to add features to it. These features all hugely increased the complexity of HTML renderers, and with complexity came bugs.
Could you build a smaller, simpler, safer web? Sure. It's called HTML4.