Not always. In some cases, the bank will simply remove one name upon request and a modest fee.
I don't know what the requirements are and they probably depend on the bank, but in our case, I was the sole breadwinner when we applied for the mortgage and during almost the entire time we were married. My income was easily sufficient to make the payments, the title had been transferred to my name, and the home equity was approaching 50% of the home value, so the bank offered to remove my ex's name for $150.
Admittedly, I doubt if that's very common, but depending on the situation, it could apply.