Assuming England or Wales: potentially YES. You are married & both living in the house which is in your name. Your spouse can therefore get a "beneficial interest" in your house, whether he/she has made any contribution to the costs of it or not. The house in his/her name is probably irrelevant.
For the mortgage lender to be able to get at your house they would first have to get a County Court Judgement against your spouse for the amount owed. Your spouse would have the opportunity to put an instalment payment offer (£x per month) to the Court but the mortgage lender might refuse this & the Court might decide the offer should be rejected. The Court decision might then be one which your spouse cannot comply with - e.g. to pay the full sum forthwith.
Once your spouse has defaulted on this judgement the lender can return to Court for enforcement, which can include getting a charging order on your house. You would have the opportunity to dispute this in Court. If they get a charging order they can then return to Court to ask for an order for sale.
The above is an outline - it can become complicated. You really need professional advice from a family law solicitor or an experienced debt adviser or both.
Note that your spouse going bankrupt does not solve the problem - the Official Receiver would adopt the same attitude as regards beneficial interest.
It might be that your simplest solution would be to get a mortgage on your house to pay off the shortfall on your spouse's one - if you can afford one.