Editor's note: David Frum, a CNN contributor, was a special assistant to President George W. Bush from 2001 to 2002. He is the author of six books, including "Comeback: Conservatism That Can Win Again," and is the editor of FrumForum.
Washington (CNN) -- Americans don't usually pay a lot of attention to Spanish politics, but the election of 2004 proved an exception. The election that occurred Sunday should be a second.
The election of 2004 was seen as a referendum on the Iraq war. Sunday's election could be seen as a referendum on the euro-elites who so strongly opposed that war.
The conservatives who governed Spain in 2004 had strongly aligned themselves with the United States after the 9/11 attacks. In 2003-2004, Spanish Prime Minister Jose Maria Aznar gained the limelight -- and endured abuse -- as George Bush's most prominent ally on the European continent. Aznar joined the Iraq war and cooperated strongly with U.S. counterterrorism efforts.
Aznar was swept from power in the election of March 2004, in an election overshadowed by a terrible terrorist attack three days beforehand: a bombing of Madrid's central railway station that killed 191 people and wounded 1,800.
Aznar's replacement, Jose Luis Zapatero, ended the Spanish commitment to Iraq and sundered the close relationship with the United States. He introduced same-sex marriage to Spain and granted amnesty to 750,000 illegal aliens. He engaged in flashy diplomatic maneuvers with Turkey and against Israel.
Yet even as he jabbed aggressively at hot-button issues, Zapatero was visibly befuddled by Spain's gathering economic challenges. Indeed for a long time, Zapatero seemed not to comprehend that Spain faced any economic challenges at all.
I made a couple of visits to Spain during the early Zapatero years. The officials I talked to then seemed almost giddy with optimism. For centuries, Spain had lagged behind the rest of Europe economically. Now at last the economy was surging. In the early 2000s, average living standards caught up to those of Italy; if Spain (they said) continued to grow at current rates, it would catch up to France within the decade. Spain created nearly half of all the net new jobs created across the whole continent of Europe in the years between 2000 and 2005.
Now we come to the fine print. If you looked closely, the Spanish economy of the 2000s was a very sick puppy.
Spain had signed up for the euro currency back in the 1990s. The currency launched in 2002.
Signing up for a monetary union with Germany created a temporary illusion of wealth for the people of Spain.
The German economy is much more productive than the Spanish economy. One way a less productive economy can adjust its trade is by allowing its currency to depreciate. The advent of the euro deprived Spain of that option. Instead, the price of German goods and services steadily declined inside Spain. Result: Between 2002 and the onset of recession in 2008, the Spanish trade deficit tripled, from 3% of GDP in 2002 to more than 10% in 2008.
You might wonder: wait a minute! If the price of German goods and services declined inside Spain, then logically the price of Spanish goods and services (including vacations) must have risen to Germans. So how did Spain finance its German buying boom?
Answer: The same currency union that cut the cost of buying goods from Germany also cut the cost of borrowing money from Germany. The euro did to the German-Spanish economic relationship exactly what China's currency manipulation has done to the U.S.-China relationship.
Between 2002 and 2008, Spanish households went on a borrowing binge. They used the borrowed money to build and buy new homes. Through the 2000s, Spain built houses at a rate of 700,000 a year - more than Britain, Germany and France combined.
Spain built shopping malls and office buildings to match. By 2008, construction accounted for a staggering 16% of the Spanish economy. And all of it was financed by debt: Spanish households accumulated debt equal to 90% of GDP (only slightly less than U.S. households at the top of the housing bubble), and Spanish businesses had accumulated debt equal to 205% of GDP (vastly more than U.S. business has ever borrowed).
Americans well-understand how this game ends. One day, the market loses faith that housing values must endlessly rise. The bubble pops. Asset values tumble. The debts remain. As debtors scramble to service their debts, they cut back their buying of goods and services. That causes a recession, which causes asset values to tumble more, which causes debts to go into default -- and the whole economy painfully unwinds.
Spain now faces nearly 22% unemployment -- Great Depression levels -- and staggering government deficits. The government must cut to balance its books if it is to remain within the euro, but government cutbacks only make it that much more difficult for households and business to service their debts.
Zapatero slunk out of town a little while ago. Good riddance to the man who boorishly insulted the American flag at the Spanish National Day parade in 2003 to score a point with the left wing of his political party.
Spain's conservatives scored a crushing victory in the Sunday vote, as the Spanish people try any desperate measure to restore their lost prosperity. But it will take more than an election to do the job. It will take a grand rethink of the whole euro currency project, a rethink that either emancipates Spain to quit the euro and export enough to repay its debts or else reduces the debt enough that Spain can sustain its expensive new currency.
The opinions expressed in this commentary are solely those of David Frum.