Joseph J. Thorndike is a contributing editor for Tax Notes magazine and the author of “Their Fair Share: Taxing the Rich in the Age of FDR.”

“Outrageous,” declared President Obama. “Unthinkable,” said Sen. Dick Durbin (D-Ill.). “Offensive,” said Rep. Darrell Issa (R-Calif.).

There is no shortage of indignation over the Internal Revenue Service’s targeting of conservative groups seeking tax-exempt status. And it would be outrageous — if it weren’t so predictable. It would be unthinkable if it hadn’t happened before. It would be offensive to Congress if it weren’t partly Congress’s fault.

Yes, it’s Congress that forces the IRS to get political. It tasks the agency with policing the line between “political” and “social welfare” groups, between “electioneering” and “educational” activities. At times, that mandate is further complicated by pressure from the White House, and at least twice in the past 50 years — during the Kennedy and Nixon administrations — the IRS has carried out executive orders to conduct explicitly ideological investigations. But even in the absence of any venality, even when politicians stand aside while well-intentioned regulators try to do their jobs, we shouldn’t be surprised that politics intrudes.

Congress has long required that nonprofit organizations accept certain restrictions, including limits on political activity, in exchange for tax exemption. Straight-up charities — known as 501(c)(3) organizations, after the section of the tax code creating them — are barred from engaging in any meaningful political activity. By contrast, 501(c)(4) organizations have more freedom to get their hands dirty.

These “social welfare” organizations — a category once dominated by civic leagues and volunteer associations but now comprising many distinctly political groups — can’t make politics their primary focus. In practice, however, they can spend anything short of 50 percent of their time fighting the good political fight. They’re not supposed to campaign for specific candidates, but they’re allowed to engage in voter education, and sometimes they “educate” voters about why an incumbent politician has a horrible record and needs to go. As a bonus, 501(c)(4)s don’t have to disclose where their donations come from, which has made them popular destinations for corporate contributions allowed by the Supreme Court’s 2010Citizens United decision.

These regulations inevitably require the IRS to make subjective judgments. Does an advertisement sponsored by an organization under review constitute electioneering? Or is it just an expression of political opinion? Does it matter if arguments are balanced? If politicians are called out by name? Some of these questions are easy to answer — some of the time. More often, the line between acceptable and unacceptable behavior is hard to see. But Congress expects the IRS to find it.

Even when pursued conscientiously, the process remains open to charges of abuse — charges that are all too plausible, given the agency’s history.

In the argot of righteous indignation, calling something Nixonian is always appealing. In the case of the IRS, it’s practically irresistible. The agency’s escapades in the early 1970s were especially lurid, featuring not only the famous Nixon “enemies list” but also a secret IRS task force with a notably ominous name: the Special Services Staff, or SSS.

The Nixon years have been a popular point of comparison for the current IRS scandal, which involves a “be on the look out” list drawn up by the agency’s “determinations unit” in Cincinnati. “It is absolutely unacceptable to single out any political group — right, left or center,” Durbin declared in a typical statement. “It goes back to some of the worst days of the Richard Nixon administration.”

Well, yes and no. Yes, in the sense that both then and now, the IRS used ideological criteria to target political groups. But no, in the sense that the SSS was a major project, conceived and organized at IRS headquarters and closely linked to intelligence activities conducted by other agencies, including the FBI. Established in 1969, the SSS was charged with battling “an insidious threat to the internal security of this country.” More specifically, it was expected to gather information about “extremist” groups — a loose definition that came to include more than 11,000 organizations and individuals, most drawn from the civil rights, antiwar and New Left movements.

Today’s scandal — apparently originating with low-level bureaucrats and potentially involving only 96 organizations that received extra scrutiny — doesn’t come anywhere close. More useful context can be found in the IRS’s adventure in ideological profiling during the Kennedy administration. This earlier episode was smaller and less shocking than the SSS affair. But for exactly those reasons, it better illuminates the underlying problems.

In 1961, the IRS established an Ideological Organizations Project to examine the activities of various political groups. The agency took its cue from President John F. Kennedy, who had publicly questioned the activities of conservative nonprofits. “I remember that the president made a speech and I got a call from the White House again,” recalled then-Commissioner Mortimer Caplin in his official IRS oral history. “The right-wing organizations were believed to be overstepping their ­tax-exemption bounds.”

Caplin understood, however, that the agency couldn’t go off on a crusade to take down conservative organizations. “We in the IRS were very careful to try to make a balance,” he recalled. “We saw the problem in terms of: If we went running all over right-wing organizations only, we’d be in treacherous administrative waters and would be all over the newspapers the next day.” So Caplin added some left-leaning organizations to the project’s target list. Whether you consider those additions merely window dressing or a genuine effort at evenhandedness depends on your level of cynicism.

Today’s scandal is worse on that score: Although at least a few liberal groups received extra scrutiny, the use of keywords such as “tea party” to identify overly politicized applicants was clearly meant to target conservative organizations. Even a symbolic balance would have been better.

Of course, the White House’s role in the Kennedy episode was more egregious than in today’s scandal. Whereas the Kennedy-era transgressions were a response to direct White House pressure, the inspector general report released Tuesday said of the latest targeting: “All of these officials stated that the criteria were not influenced by any individual or organization outside the IRS.”

Even without calls from the White House, though, both the Kennedy-era IRS and the Obama-era IRS would have been aware that influential people thought tax-exempt organizations might be getting away with something.

Consider this, from an Obama speech in July 2010: “Because of the Supreme Court’s decision earlier this year in the Citizens United case, big corporations — even foreign-controlled ones — are now allowed to spend unlimited amounts of money on American elections. They can buy millions of dollars worth of TV ads — and worst of all, they don’t even have to reveal who’s actually paying for the ads. Instead, a group can hide behind a name like ‘Citizens for a Better Future,’ even if a more accurate name would be ‘Companies for Weaker Oversight.’ . . . It is damaging to our democracy.”

Obama didn’t point a finger at conservative nonprofits. But he blamed congressional Republicans for standing in the way of transparency. And since then, there have been plenty of media reports like one from ProPublica about “how dark money helped Republicans hold the House and hurt voters.”

It’s hard to say, without engaging in speculation, how such speeches affected the IRS. But we know from the Kennedy episode that the interests of powerful people can increase political pressure on the agency.

The most significant parallel, though, between then and now is how the IRS struggled to regulate political behavior.

Staffers on the Ideological Organizations Project were thrust into an area “fraught with interpretive difficulties,” as one agency official put it at the time. The project required them to analyze the content of books, pamphlets, radio shows and speeches. As historian John A. Andrew III has observed, “The IRS was moving into the realm of political ideologies and philosophies, something for which it was unprepared.”

Things are somewhat better today. If nothing else, the IRS has had a lot more practice. But though the agency has tried to develop more objective measures for a highly subjective process, it’s still a hopeless endeavor. We are asking the IRS to do something impossible: conduct nonpolitical evaluations of political organizations’ political activities.

The agency will inevitably fail. Sometimes it will be too hands-off, as many liberals charged after the past two elections. “Why has the IRS not enforced our laws?” asked an incredulous Sen. Carl Levin (D-Mich.) just over a month ago. Other times, the IRS will be overzealous, as seems to be the case with the current scandal.

When Obama appeared in the East Room of the White House on Wednesday to announce the resignation of the acting IRS commissioner, he talked about implementing “new checks and new safeguards” and ensuring that “there’s not too much ambiguity surrounding these laws.”

The solution lies in radical simplification. Let’s get rid of 501(c)(4) status. Encourage nonprofits to forswear political activity and become 501(c)(3)s. If they can’t stomach political chastity, let them become 527s: groups still exempt from taxes but required to disclose their donors.

Anything short of that will guarantee that we haven’t seen our last “outrageous” IRS scandal.

Read more from Outlook, friend us on Facebook, and follow us on Twitter.