The Obama administration has given up on its plan to remove the tax benefits of 529 college investment accounts, which under current law allow parents to put money away, then withdraw it to pay for their children’s education without paying any taxes on the profits. Republicans not only basked in what looked like a White House defeat, but were emphatic in their defense of the 529 tax break: John Boehner called the proposal “a tax hike on middle-class families.”

As often happens with a punctured trial balloon, we say afterward, “How could they not have known this would never fly?”

If you want to know whether an idea like this has any chance of getting support in Congress, the first question to ask is, who is going to be harmed? The 529 proposal was targeted at what may be the single most dangerous constituency to anger: the upper middle class. That’s because they’re wealthy enough to have influence, and numerous enough to be a significant voting block.

The administration’s proposal may not have been policy genius, but it was certainly defensible. While 529 plans are open to anyone, they give their greatest benefit to those who have the disposable income to make substantial contributions to them, which of course are the wealthy and near-wealthy. While different surveys have produced slightly different figures (some are discussed here), it’s clear that most of the tax benefit was flowing to parents with six-figure incomes who could afford to pay taxes on the profits of their 529 accounts.

The administration’s idea was to increase other tax credits for education alongside removing the 529 benefit, so that more tax benefits would go to those who need them more. If officials had been thinking more about the potential backlash, they might have instead proposed taking away the 529 benefit only for those with incomes over some high level like $200,000 a year. But they didn’t, perhaps because that would have been another layer of complexity to the tax code, and one of their rationales for this proposal was simplifying the available tax benefits for education.

Whatever the reason, this is what they came up with, and the details of the proposal made its demise inevitable. Not only was it opposed by Republicans, even Democrats didn’t like it; Minority Leader Nancy Pelosi personally lobbied the President to drop it, and had encouragement from Chris Van Hollen, the ranking Democrat on the Budget Committee. Is it a coincidence that both members — Pelosi from San Francisco, and Van Hollen from Montgomery County in Maryland — have lots of wealthy and upper middle class constituents who have no doubt taken advantage of 529 benefits? Probably not.

The Republicans who are crowing about the White House’s retreat ought to remind themselves that this is yet another illustration of a dynamic they often bemoan: that it’s easy to give people a government benefit, but much harder to take it away once it’s in place. And while they sneer in disgust at the moochers who get food stamps or Medicaid, the program they’re now celebrating is a government giveaway, too, just one that is mostly given away to people who don’t need it.

Here’s the real lesson from this whole affair:  If you want to create a politically bulletproof government benefit, like the 529 program or the mortgage interest deduction (which costs the government about $70 billion a year), just make sure it’s technically open to anyone, but that the chief beneficiaries will be people who are doing well. They’ll squawk if it ever gets threatened, and it’s an absolute certainty that their representatives in Congress — Democrat and Republican alike — will hear them loud and clear.