This is not a simple situation. But who will feel better if the spouse leaves? Second spouse, children? No, this is not a solution to the issue; it is simply an evasion of responsibility. It will be better for the family if none of the spouses leaves, but both quit playing if they cannot control it and problems have already arisen. If one of them just stops playing, this will not solve the issue, because the second one will sooner or later bring him back. This is an addiction, but God will help you cope with any addiction, including gambling.
Yes both of them should quit gambling. They can set an example by doing this. At least they can try to quit gambling for the sake of their children. The thing you said about affecting each other is also correct. If I see my spouse gamble in front of me, it's only natural that I too would want to gamble. Trying to be busy in life with work or resisting the urge to gamble all of these efforts will be in vain if others gambled in front of that person.