Bill Gates and Warren Buffett have it all wrong, according to Scott McNealy.

In an interview on "Squawk Box" Tuesday, McNealy—the chairman of Wayin and the co-founder of Sun Microsystems—said the wealthy should give less to charity and invest more of their money in start-ups. He said that if Gates and Buffett had given their fortunes to budding entrepreneurs rather than the needy, they could have created many more jobs.

"The last thing I want to do is tell Bill Gates and Warren Buffett how to spend their money," he said. "But imagine if they had taken their tens of billions of dollars, chopped it up into $5 million chunks and pledged it to a business plan, sponsored by an MBA graduating from an MBA school with engineers and marketeers that he's recruited and they got 50 percent of the company back to the foundation."

(Read more: Why we likely can't close rich-poor gap)

The wealthy should also pay less in taxes, since their money is poorly spent by the government, he said.

"Instead of doing the $800 billion stimulus program and took all that money out of wealthy people," he said. "What do wealthy people do with their money? They invest it, spend it, save it or give it away. And I guarantee you, any wealthy person who created that value is going to do far better doing those four things than taxing it and giving it to Pelosi and Reid and Obama."

McNealy has never been a fan of government, and has long touted the virtues of the free market. But his comments echo those of other millionaires and billionaires who have come out and said that philanthropy is a poor use of cash.

Carlos Slim in 2010 said that he could do more to fight poverty by starting companies rather than "being a Santa Claus."

(Read more: Gates tops Forbes list again)

"The only way to fight poverty is with employment," he said. "Trillions of dollars have been given to charity in the last 50 years, and they don't solve anything."

Slim, however, has since pledged billions to his foundation and joined with Gates to help fund programs to eradicate polio and to help improve global agriculture.