First of all, the debts of husband and wife should be shared.
Although all the money you borrowed during your marriage paid off your husband's debts, after all, you borrowed the money, so you are also responsible.
Moreover, you and your husband were not divorced at the time of the loan, which belongs to the joint debt of your husband and wife, so if they divorce, the money should be borne by both of you.
If you let the court decide for divorce, because your husband gambles first and belongs to the wrong party, the court will ask your husband to pay more loans and let you pay less loans as appropriate.
Second, you shouldn't tolerate your husband's gambling behavior.
According to the current marriage law of our country, the gambling debts incurred by husband and wife during the marriage relationship belong to the personal debts of one gambling party and have nothing to do with the other party.
So I think it is very irrational for you to lend money to pay off your husband's gambling debts. When you first learned that your husband gambled, you should decisively refuse his request. So even if you two get divorced, his gambling debts have nothing to do with you.
Moreover, if your husband is at fault first, you can also get custody of the children and get more property and house when divorced.
In marriage, besides domestic violence, gambling is even more unbearable. Even if you lend money to your husband to pay him back, it's hard for him to quit gambling.
Third, what is my opinion?
I think if your husband gambles, you give him a loan to pay back the money, and the money should be shared by both husband and wife after divorce. Your husband belongs to the wrong party. If you take this matter to court, maybe the court will judge your husband to pay more loans and let you pay less loans.