He is passing money on to a charity that does good for the public in their own way and the government declared them tax free.
He will still leave money for taxation in his estate.
He thinks what Gates has is good.
He could have started his own foundation to avoid taxes but anything that is a charity has to do good for others and disperse a certain amount of money a year out of the foundation or trust by law to remain a charity.