Assuming that the bank will accept the transfer of the property in lieu of mortgage repayments, normally the transfer could only proceed when each owner of the property is in agreement to do so. However, an exception can exist, under Article 1377 of the Spanish Civil Code, if a couple own a property within the matrimonial system known as ‘gananciales’ (similar, but not exactly the same as exists by default in the UK, whereupon the assets accumulated by matrimonial couple during marriage are shared equally).
Such an exception may arise within the context of family law proceedings, whereby one spouse may seek a court order affecting the rights and obligations related to to a property, such as occurs with the transfer to a bank of a property under the dación en pago process, even without the agreement of the other spouse. In such cases, a valid dación en pago may take place where only one spouse signs the agreement.
While the law normally insists that, when dealing with assets that have multiple owners, that each owner should be in agreement before transferring the asset to a third party, it permits the transfer with the agreement of only one of the owners where to do otherwise would cause a serious loss to the assets accumulated up to that point within the marriage or which would impact gravely on the future inheritance of any children.
Article 1377 of the Spanish Civil Code: the performance of acts of disposal for valuable consideration over common property shall require the consent of both spouses.
Of one of them should refuse or should be unable to give it, the Judge, after summary information proceedings, may authorise one or several acts of disposal when he should consider it to be in the interest of the family. Exceptionally, he shall provide any limitations or precautions deemed convenient. (As seen in this scholarly PDF)