D.C. appeals court judges struggled Wednesday to see how a city resident could claim to have been harmed by Congress’s decision to label itself a small business for purposes of Obamacare.

By joining the District’s small business program, Congress was able to keep taxpayer-funded payments that cover most of the cost of lawmakers’ insurance premiums on the city’s health exchange.

But a three-judge panel on the city’s appeals court questioned whether Kirby Vining, a 62-year-old plaintiff from northeast D.C., had shown the sort of personal injury that would give him standing to challenge Congress’s decision.

Mr. Vining argued city officials were using his tax dollars to break the law, but the D.C. exchange says it used federal grant money to set up the marketplace, and costs now are paid by a tax on insurance carriers.

Yet Judicial Watch, a conservative public interest law firm that sued on Mr. Vining’s behalf, said D.C. officials drew from “one big pool of money” instead of putting up a firewall between the recurring fund and tax dollars, so the lower courts should revisit their suit.

Taking a wider view, they said public funds of any stripe shouldn’t be used to prop up a system that Sen. David Vitter, Louisiana Republican, has dubbed an illegal “exemption” from Obamacare.

When it passed the Affordable Care Act in 2010, Congress required that lawmakers and staff who want insurance from their federal jobs should have to buy plans on the same exchanges set up for their constituents.

Regular Americans who buy plans through the exchange are restricted from having employers contribute to their premiums, but the Obama administration ruled Congress could take advantage of a small-business loophole, so lawmakers and staffers were able to keep the federal subsidy that pays about three-quarters of their premiums.

Judicial Watch sued the D.C. exchange in October 2014, saying Congress shouldn’t qualify as a small business.

A Superior Court judge dismissed the lawsuit one year ago, noting the provision demanding Congress‘ participation in the exchange was vague enough to permit the city to consider it a small business.

Judicial Watch says the city government’s own documents prove that D.C. is drawing down from its general fund, making Mr. Vining unwittingly complicit in an unlawful arrangement.

“It was all one big bucket, one big pool of money,” Judicial Watch attorney Michael Bekesha told the judges.

He said the appeals court should find the lower court erred in tossing the suit at a preliminary stage, without a more extensive examination of city documents.

The D.C. exchange’s attorney, Jason Lederstein, insisted there was no co-mingling of funds, so Mr. Vining has no case.

“With no taxpayer money being spent, there is no injury, there is no standing,” he told the panel.

At one point, Associate Judge Stephen H. Glickman asked if anyone would have standing to sue if the government is, indeed, acting illegally.

Mr. Lederstein said members of Congress and their staff members are they only ones who come to mind, as they might claim their federal benefits suffered “an immediate change” under the arrangement with D.C.

“You can’t just roam the country looking for illegality,” he said.

Mr. Vining said he was flabbergasted by the idea that Congress could be the aggrieved party, since they wrote the law.