Because mortgage loans are handled on a family basis. As long as you are married, have a marriage certificate, count as a family, and one party has a credit history stain, the bank will not give you a loan.
It is necessary for the tainted party to pay off the previous arrears, pay the late fee, complete the formalities and wipe the ass. After five years, the banking system will automatically clear the bad records, and then you can apply for a loan.