Or they could legitimately be trying to make the world a better place along with making money. I know, naive right?
Yeah it's pretty naive. Google trying to make the world a better place would actually be illegal and would place the managers in jail for defrauding investors. Google's mission is to make as much money as possible, typical tactics include creating a good corporate image.
First of all: no jail. This is civil law, not criminal.
Second: it's pretty hard not to have an excuse to do anything you want if you're the board + management. Google, and most other companies, give to charitable organisations, for example. "Now", you'll say, "they're just doing this for PR".
Maybe... But using the PR argument actually works perfectly fine for anything altruistic a company may do.
Unless management explicitly states that they're harming investors for the public good, it's almost impossible to run afoul of the law. Sick pay that exceeds the law? Important for employee retention (and PR). Match your employees' donation to any certified charity? Important to create a community (and PR).