Presidential candidates from Bernie Sanders to Donald Trump have condemned their tax-dodging. Investors have deplored their outlandish fees and poor returns. Showtime has made one of them the arch-villain of its new series “Billions.”

Hedge fund managers may be feeling put-upon these days. The rest of us should be glad they’re finally getting the scrutiny they deserve, for a range of shadowy practices that cannibalize the real economy and aggravate the problem of extreme and growing economic inequality — and for the tax ploys and rigged rules that make it possible.

What is a hedge fund? In theory, it’s a way for wealthy and sophisticated investors to place high-risk bets in search of above-market returns. In practice, the hedge fund industry has expanded well beyond that role; it has also exploded in size, from about $200 billion in assets at the turn of the century, to nearly $3 trillion today.

Hedge funds were major traffickers in the toxic securities that brought down the financial system eight years ago. Because many of them now market aggressively to pension funds and institutional investors, ordinary retirement savers can lose big when hedge funds fail to generate returns extravagant enough to justify their extravagant charges. More and more of these funds use stealth tactics to build up potent but undetected market positions, enabling them to aggressively bring about the results they’re seeking — results that serve their interests at the consistent expense of workers, communities, and the wider society.

So-called “vulture funds,” for example, buy up debts of troubled companies, countries and municipalities at pennies on the dollar, and use their muscle to demand full repayment. Other activist funds acquire large stakes in publicly traded firms and push for mass layoffs, outsourcing deals and other moves calculated to juice up share prices in the short term, usually at a long-term cost to the companies involved.

None of the industry’s strategies have been working well recently — not if you measure them by investor returns. Nevertheless, the top 25 hedge fund managers made a combined $11.6 billion (an average of $40 million each) in 2014 — about $3 billion more than all the country’s 158,000 kindergarten teachers got paid that year.

Despite their power and influence, hedge funds face relatively little oversight and regulation. Fortunately, though, momentum is building for much-needed reforms.

The complexity, opacity and international scope of these funds has made it confoundingly difficult to get them to pay their rightful taxes; some experts have described them as “audit proof.” Congress and the IRS have finally begun to address some of the most egregious abuses, such as setting up faux reinsurance companies on Caribbean islands, but much more remains to be done.

One obvious step — supported by all three Democratic presidential candidates plus Donald Trump — is to end to the so-called carried-interest loophole, which permits fund managers to classify their incentive fees as capital gains, and sometimes (through accounting trickery) as long-term gains qualifying for a lower tax rate. This action alone would raise billions of dollars a year.

There is also growing support for efforts to curb wasteful high-frequency trading, where hedge funds are significant players, using sharp practices and ultra-fast computers systematically to get the better of other investors, undermining the integrity of the markets in the process.

Here, the most promising remedy is a financial transaction tax — a fee too tiny to affect ordinary investors but large enough to make high-frequency trading uneconomic (and incidentally to generate significant revenue and help nudge the financial markets back toward their core mission of providing capital for serious private and public investment).

Just as important, the Securities and Exchange Commission and Congress need to bring hedge fund disclosure rules into the 21st century. Despite improvements mandated by the Dodd-Frank Act, regulators don’t have enough data to monitor the risks of these funds properly. Legislation introduced by Rep. Nydia Velazquez, D-New York, would reduce the current 10-day lag in reporting and close a derivative loophole, making it harder for activist funds to secretly amass influential positions and launch sneak attacks. Sen. Tammy Baldwin, D-Wisconsin, is working on a bill that takes similar and further steps in that direction.

These are common sense measures that would begin to curb the abuses of the hedge fund industry. That, in turn, would bring us a step closer to having a financial system that serves, rather than obstructs, the cause of a stronger, more productive, and more equitable economy.