Secrecy and mistrust in relationships is a big issue, as trust is the foundation for a strong relationship. Moreover, when you're with someone, gambling isn’t just a personal choice — it’s a risk zone. Even if someone gambles “moderately,” the consequences can still be serious. Also, if it's just something small one does as leisure activities, I don't see the reason not to disclose it. Of course, if there's kind of a 'don't ask, don't tell' principle, then it's a different story, but still presupposes that gambling is shameful in some way.
I do not think this is a "dont ask, dont tell" situation, to be honest. If one is a gambler it would be better to disclose it to one's partner from the very beginning, so later on the relationship our significant other won't feel betrayed and deceived by us. That is specially important as one starts to get more serious and both move together and start to share expenses to keep a household. What would a woman feel if she found out their personal finances are at risk because her husband has been taking a considerable amount of money to do something she is not even aware of?
It is a delicate situation.
Whenever I date someone and we start to see ourselves more often, I feel it is my responsibility to mention I consider myself to be a casual gambler and I also mention some of my experiences losing money online because of my bad luck. If the girl starts to take distance from me because I am a gambler, then we both saved time and can carry on dating other people who are more aligned with our personal believes and values. I think it is rather a question of common sense.
But that is just my opinion, there will be people who may prefer not to disclose it to their partner and slowly start quitting gambling, for the sake of their household economy.