Gates is doing this because in a few short years he went from America's darling super rich success story, to the monopolistic Satan most of us tech people remember. He was not prepared for being vilified so quickly and completely during the anti-trust years.
Same thing as Andrew Carnegie: After the violent putting down of steel worker strikes, Carnegie was seen as the devil himself. He was so upset that this would be his legacy, Carnegie went about doing charitable work to change his image. You probably have a library he built within 50 miles of you, no matter where you live in the US.
Gates is doing the same thing. He does not want his legacy to be that of a businessman, but rather, that of a philanthropist.