The oilmen were drilling deep below the Gulf of Mexico when a rise of pressure from natural gas blew out the wellhead. A safety device intended to seal the well failed, and tens of thousands of barrels of oil a day began to shoot up into the Gulf waters. Engineers tried stopping the flow with mud and junk and lowering a cap over the leak. They spent months digging relief wells to plug the hole. Eventually they stanched the flow, but it took the better part of a year and contaminated the waters with millions of barrels of crude. Fisheries had to close, birds and other wildlife perished, and vast lengths of coastline were soiled.

That catastrophe happened in 1979, when the Ixtoc 1 drilling rig sank. The parallels between its demise and the Deepwater Horizon disaster that began in April are chilling. We do not know how the ongoing story will end, and we may never be certain what happened in the ocean depths. That two events 30 years apart have followed nearly the same script shows we—not just the oil industry but the entire nation—have failed to address the underlying reasons for these debacles.

In the intervening decades, the oil industry has made huge technological advances. Sophisticated imaging and steerable drills let drillers extract a larger fraction of the available oil at far greater depths and leave less of a footprint on the surface than ever before [see “Squeezing More Oil from the Ground,” by Leonardo Maugeri; Scientific American, October 2009]. Based on these innovations, oil companies have made the case for opening up more coastal areas and the Arctic wilderness to drilling, and they have gotten a sympathetic hearing in Washington, D.C.

Unfortunately, the less sexy human side of the equation has not gotten the same attention. The number of snafus that led to the latest calamity is breathtaking: time-stressed managers who cut corners, regulators who were literally in bed with the industry, politicians who hurried along an ideological agenda of deregulation.

How does an industry organize itself into teams of engineers and technicians across thousands of rigs and dozens of companies, to reach oil trapped in increasingly forlorn places, in a way that is robust enough to tolerate human error? It is not easy, but it can be done. High-tech, high-risk enterprises as diverse as nuclear power stations and U.S. Navy aircraft carriers have learned to keep accident rates remarkably low. Accidents may be inevitable, but the chance of catastrophe should be nearly zero.

The first step is to make realistic assessments of risk at the outset. That may seem obvious, yet it is not routinely done for deepwater drilling. In documents BP submitted to its regulators at the U.S. Minerals Management Service, the company downplayed the risk, says Robert Bea, a petroleum engineer at the University of California, Berkeley, who spent decades as an engineer in the oil industry, including a stint at BP. “We went into this with our eyes partly closed,” he says. “We’ve excluded from our thinking these nightmares, and we haven’t honored the Boy Scout’s motto: be prepared.”

Second, government oversight needs an overhaul. The Minerals Management Service has been chronically underfunded and has systematically ignored the advice of its own scientists, let alone independent researchers. Even before the Deepwater Horizon sank, the Obama administration had planned a reorganization of the agency. It is not the regulator’s role to keep BP from betting the company on a single well but to make sure it does not bet the entire Gulf of Mexico along with it.

Finally, if we expect oil companies to manage risk better, then society as a whole needs to do the same. The market forces that encouraged BP to take ill-considered risks are largely of our own creation, as stockholders, consumers and citizens. The hodgepodge of subsidies that masquerades as our current national energy policy invites disaster; it fails to grapple with the urgent need to stop wasting energy and start encouraging clean sources. Every day we still need 85 million barrels of oil—the equivalent of more than 25 Ixtoc spills—to keep the wheels of our society turning. President Barack Obama is entirely correct to speak of the giant slick now oozing around Florida as another reason for a comprehensive energy policy.

Pundits and politicians have criticized the president for being slow to respond to the disaster, but that criticism misses the mark. The point is not to respond but to anticipate. Once again, Deepwater Horizon has proved the sad maxim that it takes a crisis to focus attention on an issue. Maybe we can finally learn now what we should have learned 30 years ago: that we should not just be mopping up the last crisis but preventing the next one, whether it is an oil-rig blowup or ice sheets calving into the sea.