Basically: Yes!
But it is very difficult to generalize if it is not clearly separated throughout the entire time who paid what and how. However, if not clearly regulated otherwise beforehand, the spouse is definitely entitled to a value equalization, since you are jointly assessed during this time and thus the repayment of the loan comes from your joint account. From which account it is debited is not decisive.
If this is not desired: prenuptial agreement