Want to hear something crazy? An insane accounting rule lets some companies book a profit when credit default spreads on their own debt widen, even though it's a sign that investors are worried. A company could theoretically -- the thought goes -- repurchase its own debt at a discount, leaving the difference as a gain. Even if it doesn't repurchase the debt, it still gets to book the spread as net income.

Conversely, when a company's default spreads tighten -- a sign that investors are feeling confident about its future -- it's often forced to book a loss. Follow that? Bad news = profit. Good news = loss. Accountants can be funny people.

Morgan Stanley (NYSE:MS) knows all about this. Last quarter, Citigroup (NYSE:C) and Bank of America (NYSE:BAC) booked big gains on widening credit default spreads as nationalization fears loomed, while it reported a loss only because its spreads contracted as investors regained confidence. This quarter is the same deal, with a barrage of fictitious "losses" as spreads on its own debt continue to shrink.

Morgan Stanley's second-quarter earnings came in at a net loss of $1.10 per share, compared with a gain of $1.02 per share last year. But the results included $2.3 billion -- or $1.32 per share -- in charges related to tightening credit default spreads. Without this one-time, and utterly absurd, charge, a nice quarterly profit would emerge. There was also a $0.74-per-share charge related to repaying TARP funds to taxpayers -- a nonrecurring expense, of course.

In truth, most of the bank earnings reported over the past week don't reflect anything close to reality. Bank of America and Citigroup's income was made up of selling assets. Goldman Sachs (NYSE:GS) and JPMorgan Chase (NYSE:JPM) raked it in after an equity-raising free-for-all. Now Morgan Stanley is reporting losses tied to reclaimed investor confidence. "Reality," they say, "can be beaten with enough imagination."

For related Foolishness:

Fool contributor Morgan Housel doesn't own shares in any of the companies mentioned in this article. The Fool has a disclosure policy.