I don't think you should hide anything from your spouse, and that includes gambling too. Gambling addiction is bad on its own, then hiding it from your partner is a betrayal. Gambling has to do with your finance, so it's very important you share it with your partner, so you both can even make a budget for it, so it does not affect your finances.
Hiding your gambling habit from your partner could lead to divorce, when they find out that you have been hiding it from them. They will definitely feel betrayed and it's really going to affect their trust for you, and when trust is broken in a relationship, it's might lead to a divorce.