Bill Gates is the richest person in the world — but one retired New York hedge-fund mogul thought the software pioneer’s Giving Pledge was “practically worthless.”

Robert W. Wilson, a well-known philanthropist who had given away $600 million of his fortune as of 2013, abruptly turned aside Gate’s 2010 request that he sign the Giving Pledge.

The pledge pushes billionaires to give away a bulk of their fortune while they are alive, or in their will.

Wilson found especially problematic the pledge’s loophole that allowed signers to gift their wealth to a family-controlled foundation.

“And these foundations become, more often than not, bureaucracy-ridden sluggards,” Wilson wrote to Gates in a June 2010 e-mail, a copy of which was obtained by the website BuzzFeed.

“I’m going to stay far away from your effort,” Wilson told Gates in the same e-mail.

Last week, Wilson, 86, took his own life by throwing himself from his luxury Upper West Side high-rise, just a few months after suffering a debilitating stroke.

Wilson. who made his fortune after founding Wilson & Associates, a hedge fund whose specialty was short-selling, was a champion of Catholic schools and environmental causes.

Gates, who has been famously joined in his Giving Pledge effort by Warren Buffett, was undeterred by the brushoff.

The Microsoft co-founder, worth $78.5 billion, admitted to Wilson in a reply e-mail three days later that “some people set up a foundation without a strong focus or leadership and with high overhead.”

He told Wilson the group of pledge signers “would benefit from your joining in.”

Wilson, by signing the pledge, could inspire younger people to increase their giving, Gates wrote.

Wilson, in a second e-mail to Gates, was a bit more testy.

“You, being a liberal, think you can change people more than I think,” he wrote.

Wilson zeroed in on Gates’ “younger” people focus.

“When I talk to young people who seem destined for great success, I tell them to forget about charities and giving,” Wilson replied to Gates. “Concentrate on your families and getting rich — which I found very hard work.”

“When people reach 50 and are beginning to slow down is the time to begin engaging them in philanthropy,” added Wilson.

Appearing weary of the give-and-take, Wilson signed off simply: “I’d greatly appreciate just leaving it at that.”

The debate between giving while one is living or after death is a big subject in philanthropy circles, Paul Carttar, of the Bridgespan Group philanthropy advisory firm, told The Post.

“Bill Gates has committed an unfathomable amount of money to his interests.

“Robert Wilson had a different approach, but similar commitment.

“It is obviously incredibly tragic that this dialog comes to light under these circumstances.”

Carttar said he believes Wilson’s philosophy has a lot of merit, since it involves giving today, and not waiting for tomorrow.

“But you don’t have to believe other styles have no merit,” he added.

The Gates Foundation did not return e-mails for comment.