Alan Greenspan, one of the key perpetrators of the housing and debt bubble, said a truly amazing thing in his Congressional testimony.

He said, "those of us who have looked to the self-interest of lending institutions to protect shareholders' equity (myself especially) are in a state of shocked disbelief." He also argued that the housing-market collapse happened "because the data inputted into the risk management models generally covered only the past two decades, a period of euphoria."

Now, Greenspan is surely at least a bit brighter than your typical light bulb, but he seems to be three foot-candles behind in his understanding of the biggest financial crisis of our time.

To him, the models were just broken -- but that totally misses the bigger picture. This crisis isn't simply the failure of a model. It's proof of the biggest flaw in capitalism: All the participants can act completely rationally, and still set up such huge instabilities in the system that they threaten the global economy.

Just like Spock
Despite all the hand-wringing to the contrary, almost all the perpetrators of this crisis were actually acting logically.

Take the people who bought houses that they couldn't afford. If you don't have a lot of assets to lose, and someone's willing to give you a low-interest, nothing-down loan to buy a house during a bull market, it makes a lot of sense to take it. In fact, it makes sense to take as much as they'll give you. If prices rise, you make a killing. If the market falls, you walk away. Heads, you win. Tails, the bank loses.

Stupid loans made perfect sense for executives at lending institutions, both personally and professionally. Personally, you reap the benefits of the loans in the form of bonuses -- which are based on the short-term performance of the company. Professionally, if you conservatively avoid making the liar loans, you'll lose the company money and likely lose your job to boot.

It was even rational for Moody's (NYSE:MCO) to use less-conservative models when rating securitizations -- because they make money rating deals. Why would they discourage securitizers and risk cutting off the flow of cash?

The only stakeholder for whom stupid lending didn't make sense was ... the shareholder. Why? Because, in the end, we bore the risk for all of that stupid lending. Even among the survivors, the carnage has been extreme. Citigroup's (NYSE:C) plunged from above $50 to below $14. Fifth Third Bancorp (NASDAQ:FITB) has fallen from $40 to $11.50. And AIG (NYSE:AIG) managed to burn both shareholders and taxpayers with its plunge from $70 to $2.

Shareholders are supposed to be represented by the board of directors, who are supposed to force management to strategize for the long term. Since management usually nominates members of the board, however, a director will usually side with management when there's a conflict with shareholders. In other words, it's logical for directors to act like weenies.

Watch your own back
Everyone might have been acting rationally, given the small slice of the world they were working within, but it added up to a pretty substantial meltdown. All this rationality has two implications.

First, rationality won't save us -- precisely because everyone is working within only a tiny piece of the whole puzzle. That's where regulators are supposed to step in, allowing people and institutions to do the 920,321 things that won't destroy our economic system, but stopping them from doing the 97 things that can. But try telling that to Mr. Greenspan.

Second, we as shareholders are dependent on management acting with prudence and integrity -- and not just taking the easier and more rational path of making risky bets to achieve short-term profit goals. And that means being paranoid about the management of the companies you're investing in.

Consider these three ways to deal with these challenges.

Find management that thinks like owners
If executive pay is ridiculous, it gives you a clear indication that management isn't running the business for you. The birthday party that Tyco's (NYSE:TYC) former CEO Kozlowski threw using company money is the most over-the-top example, but it seems like new examples of executive greed surface every week.

Of course, one way to find management that thinks like owners is to find management that is owners. If insiders own significant equity, they're likely to fight hard to preserve it.

Look carefully at debt and leverage
It's no coincidence that the investment banks had insane leverage, and that they're among the hardest hit in this crisis. For instance, before recent funding, Morgan Stanley (NYSE:MS) and Goldman Sachs (NYSE:GS) had debt-to-equity ratios of 30 and 22, respectively. At those levels, a mere 5% loss is enough to wipe out shareholder equity.

Even without losses, debt can sink a company if it is unable to roll over or pay back the debt when it matures. That's a crucial issue right now, since the debt markets are running scared. But in every market, it's smart to steer clear of companies with significant debt for their industries.

Focus on businesses that you can buy with a margin of safety
If you buy far enough below fair value, then even if something goes wrong, you're still likely to make money. Even businesses with great management can run into problems, so always protect your downside with a substantial margin of safety.

The Foolish bottom line
It might seem counter-intuitive in this volatile market, but the market crash means there are many stocks selling with wide margins of safety -- and some of them have the kind of management you want in your corner. But it pays to be paranoid.

Those are the kinds of stocks we look for at our Motley Fool Inside Value investment service -- and right now we're recommending two companies that fit that profile. You can find out what they are -- and get our other recommendations for new money now -- by taking a 30-day free trial. Click here to get started -- there's no obligation to subscribe.

Fool contributor Richard Gibbons thinks he's a Vulcan, but is really more like a paranoid Ferengi. He does not own any of the stocks discussed in this article. Moody's is a Motley Fool Inside Value and a Stock Advisor recommendation. Tyco is an Inside Value pick. The Fool's disclosure policy is more wrinkled than Alan Greenspan.