When the astronauts of Apollo 11 went to the moon in July 1969, NASA was worried about their safety during the complex flight. The agency was also worried about what the spacefarers might bring back with them.

For years before Apollo 11, officials had been concerned that the moon might harbor microorganisms. What if moon microbes survived the return trip and caused lunar fever on Earth?

To manage the possibility, NASA planned to quarantine the people, instruments, samples and space vehicles that had come into contact with lunar material.

But in a paper published this month in the science history journal Isis, Dagomar Degroot, an environmental historian at Georgetown University, demonstrates that these “planetary protection” efforts were inadequate, to a degree not widely known before.

“The quarantine protocol looked like a success,” Dr. Degroot concludes in the study, “only because it was not needed.”

Dr. Degroot’s archival work also shows NASA officials knew that lunar germs could pose an existential (if low-probability) threat and that their lunar quarantine probably wouldn’t keep Earth safe if such a threat did exist. They oversold their ability to neutralize that threat anyway.

This space age narrative, Dr. Degroot’s paper claims, is an example of the tendency in scientific projects to downplay existential risks, which are unlikely and difficult to deal with, in favor of focusing on smaller, likelier problems. It also offers useful lessons as NASA and other space agencies prepare to collect samples from Mars and other worlds in the solar system for study on Earth.

In the 1960s, no one knew whether the moon harbored life. But scientists were concerned enough that the National Academy of Sciences held a high-level conference in 1964 to discuss moon-Earth contamination. “They agreed that the risk was real and that the consequences could be profound,” Dr. Degroot said.

The scientists also agreed that quarantine for anything returning from the moon was both necessary and futile: Humans would probably fail to contain a microscopic threat. The best earthlings could do was slow the microbes’ release until scientists developed a countermeasure.

Despite those conclusions, NASA publicly maintained that it could protect the planet. It spent tens of millions of dollars on a sophisticated quarantine facility, the Lunar Receiving Laboratory. “But in spite of all this beautiful complexity, there were just basic, fundamental mistakes,” Dr. Degroot said.

NASA officials were well aware that the lab wasn’t perfect. Dr. Degroot’s paper details many of the findings from inspections and tests that revealed gloveboxes and sterilizing autoclaves that cracked, leaked or flooded.

In the weeks after the Apollo 11 crew returned, 24 workers were exposed to the lunar material that the facility’s infrastructure was supposed to protect them from; they had to be quarantined. The failures of containment were “largely hidden from the public,” Dr. Degroot wrote.

Emergency procedures for the lab — like what to do in the case of fire or medical troubles — also involved breaking isolation.

“This ended up being an example of planetary protection security theater,” said Jordan Bimm, a historian of science at the University of Chicago who was not involved in Dr. Degroot’s research.

The Apollo 11 astronauts’ very return to Earth also put the planet at risk. Their vehicle, for instance, was designed to vent itself on the way down, and the astronauts were to open their hatch in the ocean.

In a 1965 memo, a NASA official stated that the agency was morally obligated to prevent potential contamination, even if it meant changing the mission’s weight, cost or schedule. But four years later, on return to Earth, the spacecraft vented anyway, and the capsule’s interior met the Pacific.

“If lunar organisms capable of reproducing in the Earth’s ocean had been present, we would have been toast,” said John Rummel, who served two terms as NASA’s planetary protection officer.

The likelihood that such organisms did exist was very small. But the consequences if they did were huge — and the Apollo program essentially accepted them on behalf of the planet.

This tendency to downplay existential risk — instead prioritizing likelier threats with lower consequences — shows up in fields like climate change, nuclear weapons and artificial intelligence, Dr. Degroot said.

In the Apollo mission, officials were not just downplaying the risks; they were not transparent about them.

“Failure is part of learning,” Dr. Bimm said of the inadequate quarantine.

Understanding what didn’t work will be important as NASA prepares to bring samples back from Mars, a place much more likely than the moon to harbor life, in the 2030s.

NASA has learned a lot about planetary protection since Apollo, said Nick Benardini, the agency’s current planetary protection officer. It is building in protections from the start and holding workshops to understand scientific gaps, and it is already working on a Mars sample laboratory.

The agency also plans to be straight with the public. “Risk communications and communication as a whole is highly important,” Dr. Benardini said. After all, he noted, “what’s at stake is Earth’s biosphere.”

It’s hard to imagine the biosphere at risk from alien organisms, but the chances are not zero. “Low-likelihood and high-consequence risks really matter,” Dr. Degroot said. “Mitigating them is one of the most important things that governments can do.”