I also don't know too much about corporate taxes, but I'm pretty sure there's some benefits to giving to actual charities that goes beyond a regular business expense. "Total revenue - total costs" is the sort of tax a business can pay if their revenue is small and simple. Once you get into itemized taxes, there's all sorts of tax credits and such.
As an additional note, all the schools Google have these Google-tied products to will be bound to Google's service products, so, it benefits them in that way as well.