They're following the well-trodden path of after-the-fact philanthropy practiced by robber barons (Andrew Carnegie, John D. Rockefeller) to clean up their public image following unscrupulous business practices that brought them those billions. Less cynically, there's only so many things one can spend money on, and philanthropy is least controversial.