It isn't a person though, it's a board of directors that serves at the pleasure of the shareholders, looking after their collective interest.
It completely depends on what you think the purpose of the company is. Let me give you the mission statement of Medtronic, a very large publicly traded medical device company:
"To contribute to human welfare by application of biomedical engineering in the research, design, manufacture, and sale of instruments or appliances that alleviate pain, restore health, and extend life."
I know that the CEO couches this statement with the comment that the goal is to do that while making a "fair profit". The driving force behind a company, even a large publicly traded company, does not have to be pure profit. Granted the medical field lends itself less to outwardly spoken profit motives than what appears to be ostensibly an entertainment company. But the goal of MGM can be to make people happy, and that might just have been how MGM originally got started.
It is not impossible, rather, it's quite common, to find large publicly traded companies engaging in pure philanthropy and NOT advertising it. In fact, when they do advertise it, like Budweiser did during the last superbowl, they usually get pushback. People are so cynical that Budweiser can advertise that they delivered water to people who needed it and the immediate response is that it was a cheap way to make a feel good superbowl commercial. Many companies simply do not advertise any of the charity work they're doing. I know of companies that have their employees occasionally operating food drives and packing school backpacks simply for charity, no ads - if there's any team building it's a bonus but not the point.
If the goal of a company is always to maximize the profits to the shareholders, no companies ever engage in philanthropy without making sure that they can advertise or brand it in some way that leads to greater profits. But they do, and that's because there are few companies that, at just about any level in management, want to exist solely for making profit. That's generally not what already wealthy people want to do with their careers and lives... and make no mistake, the people who are running these companies are already wealthy people. I know that there are cynics on this board who will think that wealthy people care about nothing but money, but the opposite is true. People who are extremely wealthy often care less and less about making money (why would they?) and more about other more intangible things... like how they'll be remembered and what they accomplished.