Numbers were fairly good from two of the world's top banks, but the stocks still sold off, writes MoneyShow's Jim Jubak, also of Jubak's Picks.

Just goes to show you—you can never predict what, in the short term, the market will latch onto.

Today, Wells Fargo (WFC) and JPMorgan Chase (JPM) reported third-quarter earnings before the New York market opened. I was expecting that the two stocks might deliver a positive surprise that might be enough to start a rally in the still-depressed financial sector.

Well, sort of.

Wells Fargo did report a slight surprise on earnings, of 88 cents a share (versus expectations for 87 cents) for the quarter. That was a 22% increase from the third quarter of 2011. Revenue, however, rose just 8% year over year, to a slightly disappointing $21.2 billion (versus expectations of $21.42 billion.)

For those investors with a slightly more long-term approach than just the recent quarter, the news was solidly good. The bank continues to take market share in the US mortgage market, where Wells Fargo accounted for one in three US mortgages at the end of June. Mortgage banking revenue climbed by 50% to $2.8 billion from the third quarter of 2011.

And the bank showed a big increase in deposits, with core checking and savings deposits up $16.9 billion from the second quarter. Growing deposits give the bank more money on lend, and provide what is currently a very low-cost source of funds.

That, eventually, will work to Wells Fargo’s benefit—but today, that longer-term good news is part of what has depressed the stock’s price.

Loan demand remains soft, with loans at Wells Fargo climbing just 1% year to year. That means cash is flowing in, but loan demand isn’t strong enough to put that money to work at relatively higher rates. Which resulted in a 0.25-percentage-point decline in net interest margin, to 3.66%, from 3.91% at the end of the second quarter.

Wall Street never likes to see the difference between what a bank makes on loans and what it pays for funds decline—even if in the long-term increased deposits make Wells Fargo a stronger bank.

(It also certainly didn’t help that this week, the US government brought charges of fraud against Wells Fargo, claiming that over the last decade the bank made reckless mortgages that resulted in hundreds of millions in losses by the insurance program run by the Federal Housing Administration. Citigroup and Deutsche Bank settled similar charges for $158 million and $202 million, respectively.)

As of 1:45 p.m. New York time today, shares of Wells Fargo were down 2.84%.

It looks like traders have used a similar drop in net interest margin at JPMorgan Chase as a reason to take profits there too. As of 1:45 p.m. New York time, shares were down 1.76%.

Today before the market opened in New York, JPMorgan Chase reported record net income of $5.71 billion, an increase of 34%. Earnings of $1.40 a share—up from $1.02 in the third quarter of 2011—crushed the consensus analyst estimate of $1.20 a share. Revenue climbed 6% year over year to $25.9 billion.

Not all of the bank’s units clicked in the quarter. Revenue at the investment-banking unit fell 1%. Trading revenue was essentially flat. And the credit portfolio, which includes the remainder of the disastrous London Whale trade, produced just $90 million in revenue, down from $578 million in the third quarter of 2011.

As at Wells Fargo—and I suspect at other banks yet to report—mortgage lending was the brightest spot in the quarter. Mortgage fees and related revenue rose to $2.38 billion, from $1.38 billion in the third quarter of 2011. About 75% of mortgage volume in the quarter came from refinancings.

Credit quality continued to improve, with credit card loans overdue by 30 days falling to 2.15% of loans outstanding from 2.9% in the third quarter of 2011. Write-offs dropped to 3.57%, from 4.7% in the third quarter of 2011 and 4.35% in the second quarter.

Traders, though, seem to have focused on a decline in net interest margin as a reason for selling. This measure dropped to 2.43% in the quarter, from 2.66% in the third quarter of 2011.

Full disclosure: I don’t own shares of any of the companies mentioned in this post in my personal portfolio. The mutual fund I manage, Jubak Global Equity Fund, may or may not now own positions in any stock mentioned in this post. The fund did not own shares of any stock mentioned in this post as of the end of June. For a full list of the stocks in the fund as of the end of June see the fund’s portfolio here.