We make websites according to the latest fad and all your work will be thrown out when the business decides to change agency, framework or rebuild everything in some marketing automation tool. I've worked in an agency for almost 10 years and I have accepted that fact.
No matter how beautiful your code is, most web code is thrown away after a couple years anyway. It is just has to do what it is supposed to do, nobody cares about the code.
Agencies also deliver spaghetti code, what is the definition of that anyway? All code is spaghetti in some way. All real code is a mix of different styles and approaches. It will be a mix of OOP, Functional, declarative, imperative code. It is all custom build by different people with different backgrounds.
If you want to work on a more structured codebase then try applying to a company who have 1 product and 1 big codebase. You are likely to find much more structured code there because organising codebases take a lot of time and effort. For a larger codebase with more people working on it things like design patters, rules, best practices, linters and tests will become useful and teams will add then over time.
You will not easily find all of that in web development simply because there is no budget for it. There is only 1 goal in web development. Add as much business value in the least amount of hours.
You can be proud on what you delivered for the businesses you worked for. You solved their problems and you created value for them. No matter what the code looks like. As long as it was secure and it worked then it was perfect for what it was supposed to achieve. Don't be so hard on yourself.