Because JavaScript itself is nothing but messy and a lot of new programmers start with it and somehow learn it and follow in the same vein
These days its Javascript and the horde of fresh faced web designers and React engineers that try and reinvent the wheel. I don't think the quality of JS engineers on average is that low, programming culture has improved a lot, but without real world experience one tends to both overengineer and underestimate the problem. The JS world is very brittle because of it, and because of a frankly terrible language.