The stock for Bank of America (BAC 2.19%), the second-largest bank by assets in the U.S., is trading down roughly 17% in 2023. Its stock was sold way more than its large U.S. megabank peers, which are down slightly on the year or even a bit in the green.

After this spring's short-lived banking crisis, the investment outlook for Bank of America shifted as investors changed their expectations for funding costs and the way they examine bank balance sheets.

Despite the challenges, I'm still holding my Bank of America stock. Here's why.

Person on computer looking at stock chart.

Image source: Getty Images.

Why investors are concerned

A big part of what caused the banking crisis in March and the failure of four U.S. banks was a combination of bond portfolios that fell under water due to rapidly rising interest rates, declining deposit levels driven by higher interest rates, quantitative tightening, and more intense competition. As deposits were withdrawn from the failed banks, these financial institutions were faced with the need to sell bonds for a loss to cover deposit outflows.

All of this led investors to worry about bank bond portfolios, which they hadn't previously been as concerned about. This is because, if banks can hold bonds until they mature or interest rates stabilize, they can recoup any on-paper losses.

Bank of America got into trouble in this regard. It invested a lot of its excess deposits in low-yielding, longer-term bonds before the Fed started to raise interest rates intensely early in 2022. At the end of the first quarter of 2023, it had more than $99 billion of unrealized losses in its held-to-maturity bond portfolio. (These are bonds that the bank intends to hold until maturity.)

Bank of America had roughly $178.6 billion of tangible common equity at the end of Q1, so if in some extremely unlikely scenario, the bank had to sell the bonds while they trade at a loss it would destroy a significant amount of shareholder equity. Bank stocks often trade relative to their levels of tangible common equity.

Like most banks, Bank of America has also seen deposits decline and deposit costs rise. Deposits in the first quarter fell 2% from the sequential quarter. The bank's cost of its interest-bearing liabilities also rose from 2.18% at the end of 2022 to 2.93% at the end of 2023's Q1, putting pressure on the margin.

I also wouldn't be surprised to see deposits and overall funding costs under pressure again in the second quarter because the banking crisis only occurred for a small part of the first quarter. The effects could be much more pronounced in second-quarter earnings results.

Why Bank of America is still a buy

Unlike the banks that failed earlier this year, Bank of America has one of the most well-diversified deposit bases in the world. This includes 36 million checking accounts with more than $600 billion of deposits and billions in deposits from large corporations and businesses in a variety of different countries and industries that rely on Bank of America to help run their business.

Deposits will likely come under pressure in the second quarter, but I see this as a near-term earnings issue. When conditions stabilize, Bank of America is still going to have one of the strongest and most diverse deposit bases in the world, as well as moats in other areas of banking that can't be replicated.

Currently, Bank of America's stock trades at just over 8 times forward earnings and roughly 121% of its tangible book value or net worth. This is a very attractive entry point, compared to what the bank has traded at in the past.