I believed, it's because their sense of empathy toward other people.
After accumulating so many wealth, it will come to the point where they no longer feel any satisfaction in simply accumulating it.
Giving their money to help the society on the other hand, give a humanistic satisfaction that they wouldn't be able to get from a mere profit.