It’s important to understand that this is not just individual greed. The problem is that greed is ingrained into the system. Capitalism simply does not function without greed.
The only reason shareholders will move their capital is if the company is expected to grow. What is the point in risking your money if there is no profit? This search for infinite growth is what leads to the death of products. It creates different objectives and incentives than simply making a good product that users will pay for and providing a steady job for employees. A situation where the company does not grow but continues to make a good product and pay its workers a decent wage is an acceptable one for everyone except for shareholders.
Executives are just the middle layer between investors and workers. They make sure that investors get their return on investment, since investors don’t really give a shit about the product or even how it operates, they just care about the numbers on the balance sheet. And as someone noted in another comment, they are paid mostly in company stock so that the interests of shareholders become partially their own.
I unironically had a screening interview with a recruiter that asked “If you were creating a startup, would you use microservices?”. She didn’t like that my answer was “It depends, I don’t have enough information to answer”.