The idea of a financial-transaction tax has been kicking around for a while but has gotten more notice since presidential candidates Bernie Sanders and Martin O'Malley have been calling for it. Sanders is calling for a 0.5-percent tax on stock trades, a 0.1-percent tax on bond traders and a smaller tax on derivatives (futures and options) trades.

Read MoreOp-ed: What does Bernie Sanders need to do to beat Hillary?

There's an old adage, "If it sounds too good to be true, then it probably is." That saying is particularly applicable to the notion of a financial-transaction tax, which some have embraced as a "wonderful and profound idea." Nothing could be further from the truth. Such a tax is a profoundly bad idea that will result in many unintended consequences that would prove harmful to our economy.

In proposing the tax, Senator Sanders and former Governor O'Malley have focused the debate on curbing high-frequency trading. But make no mistake, it would have far-reaching effects that touch every investor. That's because principal-trading firms using high-frequency trading techniques now account for about half of overall exchange volume and have played an instrumental role in making markets more efficient for investors. Thanks to their technological capabilities, these firms are able to quote investors tighter prices to buy and sell stocks, which means they pay less to complete their orders. A loss of principal-trading firm activity will translate into higher costs for investors.

The proposed tax will apply to everyone in the trading ecosystem, including, ironically, the endowments that colleges and universities depend upon to fund their operations, financial aid and scholarships. The fact that it will also be paid by retail investors is one of the main reasons the Investment Company Institute, an industry association which represents the $16 trillion U.S. mutual fund industry, opposes the transaction tax. ICI says it "would raise the cost of trades that a fund makes for its portfolio and would depress fund returns." The 2015 ICI Fact Book shows that households held 89 percent of mutual fund assets.

Read MoreShort-seller who called crisis foresees calamity

You know what that means? "Mom and Pop" investors will be the ones forced to pony up.

A 0.5-percent tax may seem small, but when you take into account that investors pay an average of $84 to buy one share of an S&P 500 company's stock, this levy will actually amount to an average of 42 cents per share, paid by both buyers and sellers.

To calculate this charge on a per-trade basis, let's take the trading activity that took place on June 10, 2015 as a representative example. On that day, the Nasdaq had an average trade size of 158 shares, valued at $7,434.07. If the tax were in place, each buyer and seller would have been hit with a tax bill of $37.17 for the trade – four times greater than the $8.95 it would actually cost them to make the trade using discount brokerage Charles Schwab. For an industry that prides itself on reducing trading costs – the average retail commission charged per trade has fallen by $20 over the past decade – this tax basically rolls back the clock and eliminates many of the gains that have been made possible by market efficiency.

Historically, financial-transaction taxes have a terrible track record. One of their biggest flaws is that they simply drive investors away from markets. A June analysis by the Tax Policy Center, a non-partisan joint venture between the Brookings Institution and the Urban Institute, found that when Sweden and France introduced such taxes in 1984 and 2012, respectively, trading volume in those countries declined significantly. In the former's case, the tax "did lasting harm to the Swedish stock market," the Washington, D.C. think tank said. Less trading activity means that stock inventories will thin out and "spreads," or the price difference between a buyer and seller when negotiating a stock sale, will widen to account for this scarcity. In Canada, this very outcome occurred when regulators aimed such a fee at high-frequency traders a few years ago. Spreads there increased by nine percent and retail investors saw their returns suffer.

Read MoreHow long would it take to make machine-gun bacon like Ted Cruz?

While the prospect of a financial transaction tax sounds like a prudent measure, it's actually the very definition of irresponsible regulation. Such a tax would inflict an unnecessary financial burden on retail investors, drive participants out of the marketplace and, as a result, fail to accomplish its original goal.

Affordable college for all is a noble pursuit, and undoubtedly our capital markets can play a beneficial role in making it happen, as they have already for millions of families. But looking to gain support and funding that goal by damaging capital markets that are the envy of the world, is reckless policy.

Commentary by Bill Harts, CEO of the Modern Markets Initiative (MMI), an education and advocacy group for the role principal-trading firms, using high-frequency trading strategies, perform to improve markets for all.

