Some corporations maximise profit. Shareholders can have their corporation pursue any objective they feel like. And in practice, managers tend to run the show. And principle-agent problems crop up all over the place.
However, even for the most eccentric shareholders or self-serving managers, it's hard to sustain a corporation if it keeps bleeding red ink. So only companies that at least break even tend to stick around.
Now add a market that's at least reasonably competitive, and your typical corporation barely earns the cost of capital.
Being so close to the edge, means that the minimal goal of 'break even (after cost of capital)' can look very much like 'maximise profit' in practice.
If you built an AI that could outsource labor to humans and whose reward function is profit, your result would approximately be a corporation.