Enterprise software tends to particularly bad because it's being sold to managers who won't use it themselves. Consumer software tends to be more user-friendly (or it won't sell), but popular software isn't always what you want.
When writing software for yourself, there is a bias towards implementing just the features you want and never mind the rest. Sometimes the result can be pretty sloppy, but it works.
However, code health is a choice. You just need to know what to ask for. A coding agent can be used as a power washer to tidy up a project. This won't result in great art, but like raking leaves or cleaning your steps or plowing a driveway, it can be satisfying.
Just as you wouldn't use a power washer to clean a painting, maybe there's some code that's too delicate to use a coding agent on? But for a project that has good tests and isn't that delicate, which I believe includes most web apps, nobody's going to want to pay for you to do it by hand anymore. It would be like paying someone to clear the snow in a parking lot with a shovel rather than hiring someone with a plow.
Enterprise software is also particularly bad because many of the customers get to demand that things work the way they want. Leading to a million weird functions, toggles, configurability because some manager in charge of making a big purchase demanded that first it must do X, many of these features left with not even a single user after the original requester leaves. While consumer software the individual consumers just get what they are given, and a single product manager/team decide what's best.