Web development has a weird characteristic of not having a right way and a wrong way for writing code. Rather there is the right way or the easy way.
The right way requires skill, experience and art. The easy way requires very little and often can be googled.
And that’s why bad projects can get away with the easy way. They aren’t wrong. They’re just not right. And worse is that they sorta work so we just let it go.