You could argue that the moral thing to do is maximise profit for shareholders (this is what they are legally required to do anyway). By deliberating paying more taxes than they need to shareholders will be penalised (smaller dividends etc).
That's true. Google would be cheating its shareholders by not returning the most value through legal means. Of course, in Google's case, they probably could choose to pay more tax and get away with it, but why would they?
Returning the maximum profit for shareholders is moral only for the very narrowly focused or the short sighted. Am I being moral if I return maximum profit for my shareholders by working my workers to death? Or by polluting the land so that it cannot be used after I am done with it? How about by returning value to them with one hand (the value of their shares, dividends) and removing it with the other (the increases in individual taxes required to make up for the shortfall I created by not paying)?