When a poor nation finds a massive oil reserve beneath a rainforest with more species per hectare than in all of North America, it makes for a nettlesome problem. When you add in a huge amount of debt to resource-hungry China, it makes for an environmental catastrophe.

Ecuador thought it found a unique way to solve it in 2007, after reserves of nearly 900 million barrels of oil worth some $10 billion were discovered beneath Yasuni national park, a world biological preserve home to several indigenous groups.

President Rafael Correa worked with the United Nations to create a trust fund that would pay Ecuador not to drill. Otherwise, a country with a 27% poverty rate could ill-afford to turn down a bounty equal to about a tenth of its gross domestic product. He cancelled the project last week after global donors only put up $13 million in cash (and $167 million in pledges) out of the agreed-upon $3.6 billion, about half the revenues the country expects to generate by extracting the petroleum.

Oil companies, anticipating the decision, have already built roads and drilling infrastructure adjacent to the park, and expect drilling to begin within weeks; Correa says the development will affect about 1% of the park’s land.

Besides a purely conservationist impulse, Ecuador hoped foreign governments and NGOs see climate change as a motivation to donate. Keeping the oil in the ground is a sure-fire way to avoid putting carbon in the air, and the rainforest itself plays an important role in capturing and storing carbon. The UN estimated that the trust fund would stop 400 million tons of carbon from entering the atmosphere by not burning the oil and another 800 million tons by stopping the removal of carbon-consuming plant life.

The decision to shut down the fund is divisive in Ecuador, where Correa is a popular and populist leader in the stripe of the late Hugo Chavez but many citizens wish to protect their country’s natural heritage. His former energy minister, running against him in February’s presidential election as part of a center-left bloc that opposed Correa’s focus on exploiting mineral and oil rights, predicted that Correa’s victory would lead to the end of the trust.

Correa may be blaming foreign donors for their apathy, but some of the pressure to act today comes because of a growing debt to China, which made Ecuador direct loans of $7 billion—roughly 10% of domestic product—after it defaulted on its foreign debt in 2008, turning the South American country into something of a client state. Correa’s administration needs the money to finance development projects, but its dismal record as a borrower keeps it cut off from the global market, forcing it to take on burdensome deals like the China development loans that committed it to handing over some 75% of its oil exports.

Environmentalists call the end of the Yasuni trust a missed opportunity for Ecuador and the international community to address conflicts between development and the earth’s shrinking habitats. But untried idealism was no match for a mountain of debt to an emerging economic power.