While enshittification is certainly real, stock value or company size can't explain it all. Do startups produce shining examples of high-quality code? Not from what I've heard. It's whatever hack gets it working. Google had put a lot of work into cleaning up the messes of the past, and from what I hear from Xooglers has one of the nicest code bases around.
Quality code is hard to write. Code that works for now is pretty easy. Anyone under pressure to produce code quickly will produce crappier code. Which means every startup, every Big Tech company, everything in between, and all the other companies suddenly depending on software.
And then there are us engineers. We get a kick out of making things work, we love starting new projects, we are enamored of the newest framework. But carrying the task through all the way to nice finished products with full test coverage and beautiful code is a slog.
It's easy to blame capitalism, and it has its share of the blame. But we cannot absolve ourselves that easily.