As an intelligence operation, it must have seemed like pure genius: Recruit a Pakistani doctor to collect blood samples that could identify Osama bin Laden’s family, under cover of an ongoing vaccination program. But as an ethical matter, it was something else.

The CIA’s vaccination gambit put at risk something very precious — the integrity of public health programs in Pakistan and around the globe. It also added to the dangers facing nongovernmental organizations (NGOs) in a world that’s increasingly hostile to U.S. aid organizations.

What’s gotten attention in America is the plight of Dr. Shakil Afridi, the Pakistani physician who helped the CIA through his vaccination campaign in the tribal areas and the nearby province where bin Laden was hiding. The doctor was sentenced last week to 33 years in prison for treason, prompting indignant protests from Defense Secretary Leon Panetta and Secretary of State Hillary Clinton.

U.S. officials shouldn’t treat the Afridi case simply as outrageous behavior by Pakistan. They’re right that the doctor’s actions weren’t treasonous: He was seeking information about terrorist leaders who were Pakistan’s enemies. I hope he’ll be released, but in any event Afridi and his handlers should reckon with the moral consequences of what they did.

Here’s the painful truth: Some people may die because they don’t get vaccinations, suspecting that immunization is part of a CIA plot. The rate of polio infection is rising in Pakistan, Afghanistan and Nigeria, in part because people believe conspiracy theories about vaccination. If the spread can’t be reversed in these three countries, warns a recent World Health Organization report, “polio eradication will fail.”

Among the organizations concerned is Save the Children, the biggest foreign-aid agency in Pakistan. According to the New York Times, Afridi told Pakistani authorities he was first contacted by the CIA through Save the Children, a claim that the organization denies. The Times reported that, after Afridi’s arrest last July, the NGO’s staff had been monitored by Pakistani intelligence and shipment of its medical supplies had been held at the border. A spokesman said Tuesday that the group hasn’t had any problems in recent months.

The potential danger for health workers was outlined in a Feb. 21 letter to CIA Director David Petraeus from Samuel A. Worthington, the president of an alliance of 200 NGOs that operate abroad. He warned: “Since reports of the CIA campaign first surfaced last summer, we have seen a continued erosion of U.S. NGOs’ ability to deliver critical humanitarian programs in Pakistan as well as an uptick in targeted violence against humanitarian workers. I fear the CIA’s activities in Pakistan and the perception that U.S. NGOs have ties with intelligence efforts may have contributed to these alarming developments.”

CIA spokesman Preston Golson, queried for this article, said he couldn’t comment on “any possible operational activity.” But he noted: “The agency is receptive to the views of the NGO community, and met with community representatives for a full and frank exchange on their concerns.”

The Afridi case is an example of what the CIA calls “cover for action.” The doctor was running a real vaccination program that gave him a reason to visit the areas where al-Qaeda operatives were hiding. A senior U.S. official explains: “Dr. Afridi was asked only to continue his program. . . . The vaccinations were real, and he never harmed a soul in the course of this campaign.”

Though Afridi never obtained bin Laden’s DNA sample, he did inadvertently confirm that the courier residing at the Abbottabad compound practiced extraordinary operational security, which was important intelligence. After bin Laden was killed, the doctor was offered options to leave Pakistan with his family, but he decided to stay, according to the U.S. official.

“There must have been a better, more ethical, way,” writes Heidi Larson, a public health researcher at London’s School of Hygiene and Tropical Medicine, in a comment posted Sunday on the Guardian’s Web site. “This choice of action has jeopardized people’s trust in vaccines.”

Intelligence operations, by definition, operate in a gray area where the normal legal and ethical rules get fuzzy. But this case makes me wonder if some intelligence tactics, such as using health workers overseas, should be off-limits: If the operations are blown, the consequences will be too damaging, in unintended ways, to innocent people.

davidignatius@washpost.com