In asking whether the recent financial crisis could have been avoided, the crucial fact is that crises of various flavors have occurred for centuries in countries around the world. Thus, any explanation based mainly on recent factors — subprime lending, derivatives trading, or financial deregulation — cannot be the whole story. A full account must identify factors that have been present widely, and for centuries.
One such factor, without question, is profit-seeking behavior by the financial sector (call it greed if you must). No one should deny that participants in these markets are there to make money and will aggressively pursue every opportunity to enrich themselves.
But this explanation for crises is also incomplete: every industry seeks profit, yet crises occur almost exclusively in the financial sector. Why? Because governments have long protected financial institutions from the risks associated with their lending and trading activities.
The U.S. founded the Federal Reserve precisely to protect the banking sector from the losses they incurred during panics and runs. Before that, the Bank of England had long been a cozy partner of British banks, as have been central banks and treasuries in most countries for at least a century.
In recent decades, the too-big-to-fail doctrine made explicit that the U.S. will not let large financial institutions suffer the full brunt of their risk-taking; so, these institutions assumed more risk. And Fed reassurances in the early stages of the housing and credit bubbles, which the now infamous Alan Greenspan offered, just added fuel to the fire. The message emanating from the Fed was clear: don't worry too much about risk, since Uncle Alan will come to the rescue when things go wrong.
To avoid future panics, governments must learn to tie their hands and let markets punish excessive risk-taking. That is easier said than done, but nothing else can prevent future crises.