Editor’s Note: Ryan Bourne occupies the R Evan Scharf Chair for the Public Understanding of Economics at the Cato Institute. The opinions expressed in this commentary are his own.

In this week’s Democratic debate, billionaire candidate Mike Bloomberg proved that capitalists are often the worst defenders of the market-based economic system that delivered their riches.

When Senator Bernie Sanders went on the attack, openly claiming that billionaires should not exist, Bloomberg said all the wrong things. “Mike Bloomberg owns more wealth than the bottom 125 million Americans. That’s wrong. That’s immoral,” said Sanders, who proposes a recurring wealth tax that would take 8% of Bloomberg’s wealth above $10 billion, every single year.

Asked to justify his $63 billion-plus net worth, Bloomberg fumbled: “All I know is I’ve been very lucky, made a lot of money, and I’m giving it all away to make this country better…I worked hard for it.”

Given that lots of us work hard and that luck is beyond our control, this is hardly a glowing endorsement of billionaires or of capitalism writ large. What’s more, it’s wrong on emphasis. Bloomberg’s primary contribution to the economy is not his philanthropy or even the jobs his company creates, but the value of the products and services his vision and leadership provides to consumers.

Rather than pretend he’s uniquely industrious or that charitable giving is his vocation, Bloomberg should have used this opportunity to defend capitalism. In a competitive market economy, the only way for a businessman to get rich is to oversee an enterprise providing goods and services that thousands of us want to buy, at prices customers are willing to pay.

The best entrepreneurs and managers dream up new innovative products, find better and less costly production methods, identify gaps to serve markets and keep their enterprises running efficiently.

Bloomberg has gotten incredibly rich because of his media business and, most importantly, the Bloomberg Terminal – a financial industry tool that allows subscribers to access, compile, track and analyze financial information. Both are used by hundreds of thousands of people around the world because they regard them as useful, high-quality products. This is Bloomberg’s overwhelming social contribution: not the hours of hard work he puts in or how much money he gives away.

The same is true of other entrepreneurs. WhatsApp founders Brian Acton and Jason Koum developed a best-in-class app, reaching 2 billion users in over 180 countries by offering extremely low-cost instant messaging services. Given the monetizing potential of such a big user base, the founders pocketed $15 billion when the company was sold to Facebook. Sanders would lament again that this raises wealth inequality. But their riches came from providing millions of ordinary people globally with cheaper communication.

Similar stories can be told about Jeff Bezos and Amazon, the Waltons and Walmart, or even J.K. Rowling and her classic Harry Potter books.

During the debate, Sanders retorted that it wasn’t Bloomberg’s abilities that made him rich, but the toil of his workers, who are of course much less wealthy. Yet in a market economy, individual rewards are not distributed according to “just desserts,” but by supply and demand. Very few people have the vision, managerial expertise and capacity to set up or run a large successful company. Having these qualities is extremely important, as shown by big shifts in stock prices when CEOs join or leave firms.

In claiming billionaires’ wealth is “immoral,” what Sanders is really implying is that riches are somehow ill-gotten or that they could be redistributed painlessly without affecting the entrepreneurial activity that generates them.

To be sure, there is a lot of cronyism in our economy, which should be stamped out. Overly generous patent protections, trade tariffs and other government privileges can create circumstances that make some businesspeople rich at the direct expense of others. We should remove such programs.

Yet taxing all top wealth, however it is made, risks deterring innovative entrepreneurs from starting the very companies that enrich our lives, too. Recurring taxes on the same wealth, year after year, reduces the returns to risky and innovative entrepreneurship, meaning we will get less of it. They also shrink the pool of funds that allow serial entrepreneurs or investors to take on new risky projects that can really drive innovation.

The moral basis for billionaires in a market economy is that most obtain wealth by providing products, services or investments we want and need. That some work hard or support progressive politicians’ election campaigns is irrelevant. Bloomberg had the opportunity to defend his fortune by defending market capitalism from Sanders’ caricature and damaging policy ideas. In that moment, he blew it.