It is not like most of the time randomly. It is like that, because economic system is designed to work that way.
"every state has enacted a corporate statute giving managers explicit authority to donate corporate funds for charitable purposes"
https://digitalcommons.law.villanova.edu/cgi/viewcontent.cgi...
(I am not necessary saying companies should run social support. I don't think so. But they are nor responsible for anything but the profit.)
"Designed" is probably putting it too strongly. But however you characterize the process that got it that way, people did it, and people can change it with enough effort. In fact it is constantly changing, and each of us can decide the direction we are going to push it, and how hard.
"And friends, they may thinks it's a movement." — Arlo Guthrie, Alice's Restaurant Massacree
They got their reforms, so yes it was designed.
The neoliberal faction certainly has had an outsized influence (funny how proposals that the 0.1% want done end up getting a lot of positive attention more often than not), but even so, the economy as a whole is the result of a lot of political compromise and dealmaking, not to mention undirected evolution.
Edit: Same goes for basic politeness or being customer friendly. Can be very good for the stock price long term even if it doesn't matter in this quarters result.