The death of an American and an Italian hostage in a U.S. drone strike aimed at al-Qaeda illustrates not only the perils of drone warfare. It also highlights the limitations of America’s desire to fight terrorism with technology without putting boots or human intelligence sources on the ground. The terrorists managed to keep secret the location of their hostages by ensuring that they were neither visible to the drones nor mentioned in electronic communications.

U.S. President Barack Obama’s acknowledgment on Thursday of the inadvertent death of Warren Weinstein and Giovanni Lo Porto in a January strike has prompted discussion about the risk and human cost of unmanned aircraft. Pakistan, where the two hostages were killed alongside four al-Qaeda members, has often complained about the civilian deaths resulting from the drone strikes, as have human rights organizations. But that has not precluded Pakistan from developing its own armed drones.

The fascination with drones reflects the desire of leaders to be able to fight wars without risking casualties to their own side. The Obama administration has preferred using unmanned aircraft, armed with cameras and missiles, in locating and eliminating terrorists over committing troops or even intelligence officers in the field. The death of hostages, coupled with the fact that terrorists continue to recruit and multiply despite drone strikes, points to the folly of that approach.

Mr. Obama stepped up the use of drones in Pakistan’s rugged border with Afghanistan after deciding to withdraw the bulk of U.S. troops from Afghanistan. Previously, the drones had been used widely for intelligence gathering but sparingly for eliminating terrorist targets. The use of drones seemed easier than negotiating the minefield of securing support in the U.S. for a long war, or coercing allies such as Yemen and Pakistan to eliminate terrorist safe havens.

It also seemed effective, as it put large numbers of terrorist leaders out of commission. The governments of countries where the drones were deployed could easily deny their own involvement and, in Pakistan’s case, even protest the strikes as a violation of their sovereignty while covertly enabling them. Civilian casualties were always an issue but, with time, the drones became more precise.

The problem with reliance on drones, however, is not limited to civilian casualties. It is the creation of a false sense of security against terrorists through reliance solely on technology. Al-Qaeda and other terrorist groups have lost commanders to drone strikes, only to learn methods of evading them. Aware of America’s dependence on technology, the jihadis realize the value of going low-tech.

Osama bin Laden managed to live in the Pakistani garrison town of Abbottabad for years by avoiding the use of the Internet and the telephone. Only when intelligence operatives on the ground were able to follow bin Laden’s courier through various Pakistani cities did the Americans discover his trail.

Drones are a poor substitute for human intelligence and, as the death of hostages indicates, not free of risk. The terrorists can now routinely be expected to keep hostages where their leaders live to avoid being targeted by the drones. There may still be a role for drones, both in intelligence gathering and in eliminating enemies, but giving it primacy as the principal tool of counterterrorism policy is proving to be a mistake.

The ability to kill individual targets with drones has also led the U.S. to stop thinking about fresh approaches to weak and unwilling allies. The problem posed by ungoverned spaces in Yemen, Somalia, Afghanistan and Pakistan cannot be swept aside by proclaiming victory over terrorism through individual terrorist leaders’ assassination by drones. The U.S. has to persuade or coerce leaders of these countries to regain control of territories used as safe havens. There should also be a strategy to deal with governments that allow terrorist groups to advance domestic or regional interests.

The two westerners killed by drones were taken hostage while working to improve the lives of Pakistanis. Mr. Weinstein was a veteran U.S. aid worker while Mr. Lo Porto was trying to help sanitize drinking water after devastating floods in 2010.

Their death in a drone strike in the northwest tribal region should not hide the fact that their kidnappings actually took place in large Pakistani cities, which reflects poor Pakistani law enforcement. The sons of a former Pakistani prime minister and a governor of Punjab, kidnapped from the same cities as Mr. Lo Porto and Mr. Weinstein, are still in terrorist custody.

The deaths of Mr. Weinstein and Mr. Lo Porto should result in American reconsideration of its over-dependence on drones in its war against terrorism. Meanwhile, Pakistanis must stop living in denial about their state’s weakness and the depth of jihadi influence within our society.