'The man who dies rich," the Scottish-born American magnate Andrew Carnegie wrote in 1889, "dies disgraced." Practising what he preached, Carnegie subsequently gave up his day job running the US steel industry and dedicated his last two decades, at the start of the 20th century, to spending his vast fortune on building public libraries in Britain and the US, founding the University of Birmingham, and erecting New York's celebrated Carnegie Hall.

His example set the benchmark for all philanthropists who came after him – including, in Carnegie's lifetime, that other high-minded titan, John D Rockefeller, and more recently Bill Gates. Like Carnegie, Gates is determined to give away during his lifetime the billions he has made since setting up Microsoft in 1975. His chosen vehicle is the Bill and Melinda Gates Foundation, established in 2000 to bring together the couple's various charitable initiatives. And like Carnegie, Gates plans, henceforth, to run the Seattle-based charity personally.

Despite his best efforts, Dunfermline-born Carnegie didn't quite manage to empty the vaults before meeting his maker. The Carnegie Corporation continues to this day as a source of charitable funding. Gates may well have taken note of that particular failure, for he and Melinda decreed last year that they want every last penny from their foundation spent within 50 years of their deaths. It is a commitment that has been reinforced by Warren Buffett, another American billionaire, who announced in 2006 his plans to direct the vast majority of his estimated $44bn into the Gates Foundation.

Some philanthropists prefer to give anonymously. The late David Astor spent his life giving away his inherited millions, insisting only that his donations should not be acknowledged publicly. That, you may argue, is the true meaning of charity, but it is rarely heard of. Carnegie's millions bought him a kind of immortality, but by one of those quirks of history, he is best remembered not for his business acumen, but for his public buildings.

What mark, then, will Bill Gates have left 100 years hence? Well, if he has his way, not as the software visionary we know today, but as a humanitarian par excellence. His legacy will not be so much buildings that carry his name, but the less tangible contribution he has made to the sum total of human happiness.

The Bill and Melinda Gates Foundation has two principal areas of work in pursuing its commitment in its mission statement to "innovation in health and learning to the global community". There is its largely US-based public education work – investing heavily in the state school network and bringing new technology to out-of-date libraries. And then there is its international programme to combat disease and poverty in the developing world. The latter makes up 60 per cent of the total, tackling both the causes and the consequences of malaria, TB and Aids, among others, around the world.

At present the foundation's endowment amounts to $37.3bn, with a total of $16.5bn spent already, and a staggering $2bn distributed in grants in 2007 alone by the foundation's 543-strong team. No wonder then that in 2005 Bill and Melinda Gates, along with the rock star, Bono, were named by Time magazine as their "Persons of the Year".

But such a huge and public commitment to charity brings with it its own problems. There is, for a start, the clout all those billions carry. In an interview, Dame Barbara Stocking, head of Oxfam, talked about how traditional charities were now as intent on lobbying the Gates' Foundation as they were national governments.

And, however pure and laudable your motives, you cannot help but be drawn into political controversy. So in 2003, when the Gates Foundation gave a grant of $250m to promote research into genetically modified vitamins and protein-enriched seeds to combat hunger in the developing world, they were accused of having a hidden agenda to boost the US food industry in overseas markets. Earlier this year, a senior official at the World Health Organisation complained publicly that the amount of money the Gateses were putting into one particular area of malaria research was sidelining all alternative theories. And in America, their Millennium Scholarships to help those from disadvantaged ethnic backgrounds to get a college education has been attacked as racist because it excludes Caucasians.

Such controversy seems set only to increase now Gates is dedicating himself full time to the foundation. For there remain many in the third sector who are deeply suspicious, if not hostile, to the idea of a businessman who doesn't want simply to hand over his cash to charity professionals, but who also insists on playing a hands-on role in managing how it is spent. The market disciplines that have made Microsoft a world leader, some complain, just cannot be applied to charitable work, especially in areas like third-world development, where commitment needs to be long-term, persistent and tolerant of endless setbacks that mean strategic goals are rarely achieved. For all his evident good intentions and spending power, Bill Gates may just find himself taking on his biggest challenge yet.

Peter Stanford is the chairman of the spinal injury charity Aspire and a columnist in 'Third Sector' magazine