Because then they lose investors and don't have the money to upgrade their factories, guaranteeing they will fall behind China in terms of quality. Getting more profit only matters if the company can hold on to that money to pay for its own investments, and that is something shareholders voted against because shareholders wanted to control the means of production.
Capitalism hasn't been about the pursuit of profit for decades. Companies serve shareholders and shareholders get rich by selling high and buying low. By speculating on the value of assets and creating scarcity to drive up the value of those assets without ever having to sell those assets to a consumer. By legal forms of insider trading, by lobbying for the mere mention of subsidies to a sector you have assets in, etc.
The only reason capitalism still has consumers is because it still needs laborers. If all jobs were automated, every corporation can switch entirely to increasing the value of assets in the eyes of other corporations, selling business-to-business if they are selling anything at all, parceling up the planet and fighting to control the biggest chunk. Capitalism won't need us, and when it doesn't need us, getting rid of us is a fiduciary duty. They are building the robots to kill us with as we speak, and field-testing them in Palestine and Ukraine and elsewhere.