By almost any analysis, the National Flood Insurance Program (NFIP)—the recipient of a $9.7 billion bailout in the wake of Hurricane Sandy—doesn’t work. It is poorly conceived, it’s terribly mismanaged, and it encourages harmful behavior.

Of course, the same can be said for dozens of other federal efforts. What sets the NFIP apart is that, in looking to address what was at the time a clear market failure, Congress created a program that has so influenced the course of society these past four and a half decades that getting rid of it would be nearly impossible.

Before Congress set up the NFIP in 1968, only a handful of very small insurance companies wrote flood coverage as part of conventional homeowners’ policies. Although a demand for flood insurance clearly existed, nobody would sell it. This was a market failure as almost any economist would describe it. And it happened for several reasons.

Insurance works best when a large number of people who face similar but uncorrelated risks pool their risk together. But floods are heavily correlated. While they aren’t a serious concern in many parts of the country, they can be a constant menace in areas near river valleys or along coasts that face threats from tropical storms. In an era when small, local insurers that served one or two states provided most insurance, a single big flood could drive many of them out of business.

Not that the business of home insurance has ever been particularly lucrative. Over nearly any given 10-year period, the property and casualty insurance industry as a whole pays out in claims roughly as much as it takes in in premiums, and the home insurance business is one of the least attractive from an underwriting standpoint. Insurers earn their returns mostly by investing premium dollars in high quality, low-yield bonds. With very thin margins, in those years when the business is profitable at all, the main attraction to insurers of offering home insurance—required of everyone who has a mortgage—is the chance to cross-sell more lucrative products, like investments, life insurance, and automobile insurance. Indeed, no company of any size sells only homeowners’ insurance.

Most important, the data that insurers needed to make good underwriting decisions about flood risks didn’t really exist at the time Congress created NFIP. Before air conditioning and the near-elimination of malaria-carrying mosquitos made them pleasant places to live, wet areas were mostly the domain of poor “river rats” who couldn’t afford homeowners’ insurance. Because the flow of water continually changes the contours of flood-prone areas, mapping such areas remains inherently difficult and expensive and was nearly impossible given the technology of the time. And it follows that the paltry returns they expected to earn on flood insurance offered little incentive for insurers to invest in and improve these systems.

Government policy made things worse. Since the 1920s, nearly all states have passed laws to regulate how much insurers are allowed to charge. Although these laws have eased slightly since the 1960s—and vanished entirely in Illinois—they still make insurers very reluctant to take on new types of risks. They have a legitimate fear that state governments may not let them charge enough to cover their costs and, thus, face the no-win choice of either “nonrenewing” their customers or losing money.

Even worse, from the standpoint of any insurer contemplating entering the flood insurance business, Sen. Prescott Bush (father and grandfather of the Presidents Bush) succeeded in convincing his colleagues in Congress to pass a law creating a flood insurance program in 1956. While the program was never funded, its very existence in statute provided a powerful reminder that the federal government planned to nationalize flood insurance and thus was a disincentive for anyone who might otherwise have thought of investing in the market.

This combination of the nature of the flood risk, the insurance business, the limitations of technology, and the regulatory climate made it impossible to provide flood insurance in most of the country. Spurred on by the GI Bill, the new interstate highway system, and the FHA mortgage insurance created by the Housing Act of 1949, an exploding population began moving into brand new suburbs, many of them constructed in naturally flat flood-prone areas where building was easy.

Flood damages began to rise, and Hurricane Betsy in 1965, the first post-World War II storm to do more than $1 billion in damage, provided an additional potent incentive for the federal government to do something about flood insurance.

On paper, the flood insurance law passed by Congress in 1968 looked sensible: It required participating communities to take steps to avoid building in disaster-prone areas, left requirements loose enough that private companies could take on risk if they wanted to, assured that rates on all future construction would be “actuarially adequate,” and promised that the federal government would draw up the maps that the private sector needed in the first place. As an incentive for people to buy the insurance, it denied all federal aid to those who qualified for the program but didn’t buy in. Although its creators allowed it to borrow funds from the Treasury—a stop-gap measure, lest major floods had hit in its first few years—the program was intended to break even over time and, some thought, might eventually be sold off to the private sector.

Almost none of these good intentions proved justified. The requirement to purchase insurance or lose federal aid fell by the wayside as soon as hard-hit areas came crying to Congress. Government definitions of “actuarial adequacy” ended up leaving out most of the costs private companies would factor into their rates. While communities wishing to let their residents buy into the program did have to discourage the most obviously foolhardy building, poor mapping and the natural clout of local developers made these requirements a triviality. So much for a financially responsible program. “Temporary” subsidies became permanent. Congress periodically forgave the program’s debts and, following Hurricanes Katrina, Rita, and Wilma in 2005, authorized it to borrow $20 billion from the Treasury that it had no chance of ever paying back. On the eve of Hurricane Sandy, the NFIP still owed the Treasury more than $17 billion, with another chunk of debt taken out to pay claims from Hurricane Ike in 2008.

With Congress expected to re-authorize the program every five years, many aspects of the NFIP grew worse over time. Even as Congress corrected obvious absurdities—such as subsidies for writing insurance on coastal barrier islands and other areas likely to wash away entirely—members added various benefits and even made the private insurance industry a beneficiary of the program. Under a “write your own” (WYO) program that pays them to adjust claims and service policies, private insurers get to keep about a third of the total premiums collected, but take on no real risk. While this program isn’t enormously lucrative for insurance company home offices—the tasks they’re asked to undertake are reasonably labor-intensive—it’s not a money loser either. Most large, well-known national property insurers participate in this WYO program, and not a single one was willing to step forward and offer to take on any risk when lobbyists and activists surveyed them about the topic last year.

Over the NFIP’s 45 years of existence, moreover, it has influenced the built environment to such an extent that full-scale privatization couldn’t happen, even if insurers were willing. For those whose mortgages were issued by federally chartered banks, or were purchased by Fannie Mae or Freddie Mac, policy requires the purchase of flood insurance if a property faces at least a 1 percent chance of flooding in a given year. Because NFIP rates have been kept artificially low for decades, millions of people now live in places that wouldn’t be inhabited at all absent the program’s subsidies.

Under Congress’s budget rules, eliminating the program outright would actually cost more money than keeping it operating. Once it finishes paying claims from Hurricane Sandy, the NFIP will owe nearly $30 billion to the Treasury. So long as those loans are outstanding, they don’t count toward the federal budget. Discontinuing the program, on the other hand, would leave taxpayers on the hook for that debt (and for scheduled mapping improvements) without any new premium dollars coming in the door.

The legally binding insurance contracts the program offers, likewise, make it impossible for Congress not to offer bailouts like the one that took place earlier this month. Had Congress not approved the funding, flood insurance policyholders would have gone to court and won judgments ordering the government to pay the claims anyway. Furthermore, the program, to the extent it will repay its debt at all, will never reach the point where it would look attractive to private suitors.

Everybody who has taken a close look at the NFIP realizes that the program is a mess. Once the symbolic votes to end the program had passed, both Democrats and Republicans came to basically the same conclusions that changes needed to happen. A set of reforms that became law last summer was written jointly by the moderate Republican Rep. Judy Biggert (R-Ill.) and far-left Maxine Waters (D-Calif.). That bill promises to improve maps, phase out some premium subsidies, and allow the program to transfer some of its risk to private reinsurers (insurers for insurance companies).

All of these changes make sense, and no sizable organized group stood against them, but they’re hardly the kinds of radical reforms that the program would need to put itself on firm fiscal footing for the long term. Even if all of the proposed changes work as promised, the program’s finances will remain such that any state regulator who looked over its books would forbid it from operating if it were a private company, on the basis that it can’t pay the claims it will reasonably expect to receive. At best, it will take an additional round of reforms—reforms that are unlikely to until the current program expires in September 2017—for the private sector to seriously begin assuming the liability. And that assumes Congress has the political will to ask coastal property owners to see their property insurance bills soar.

Better by far that the program had never been started. International examples show that private flood insurance can work. Germany and the United Kingdom, among other countries, write almost all flood insurance through private parties. While the business isn’t a major profit center for the insurance industry, it, at least, isn’t a taxpayer liability. And building is deterred in the most flood-prone areas.

More than anything else, the NFIP offers a stern warning to anybody who wants government to solve every problem. In the case of flood insurance, even the existence of a market failure didn’t mean the public sector necessarily had a better solution. For the foreseeable future, America is stuck with the NFIP.