There are native UI frameworks where this is not nearly as big of an issue.
Too much freedom perhaps? Should you even be able to give a div an onclick handler?
What about inputs? Why do developers have to make custom inputs because the core ones are severely lacking? That's where accessibility goes wrong. Because core functionality is terrible and needs to be augmented with richer functionality (but terrible from an accessibility perspective).
There is something fundamental about this platform that does not naturally encourage good behavior. All you have to do is look at the evidence.
As an dumb little example, it's not even obvious that making a div a button is bad unless you know that it is. The platform doesn't guide you at all. It has an onClick handler the same as a button. Little attempt is made to differentiate the two from an API perspective.
I could give countless other examples, but I think I have demonstrated what I am getting at.