Whenever I am gambling, I lock myself up in my room and wouldn't want my kids to come around me at that moment, because I know that they are smart and can easily understand what I am doing. Actually, they are still very young but I still keep my gambling activities secret.
However, children can learn to know about gambling through ads on TV and on the internet and that is why it is good to monitor what they are doing with their devices and also educate them on the consequences of gambling, so that it can be a guide for them as they are growing not to involve in gambling to the extend of becoming an addict.
Honestly, that is BS what you are doing. You said it yourself, when kids can find out about gambling from TV and the internet, as well you said that is good to educate them, why the hell you lock yourself then? I know that answer. You do it not because you dont want to gamble in front of them or dont let them learn about gambling, but you do it because you dont want to get distracted. Just admit it, that you want to dedicate some time for yourself and gamble calmly and peacefully. I am sure that if your wife wants to enter your room while you gambling, you would not let her in either. So it turns that problem is not in kids learning early, but you just want some free time for yourself.