I don't think there is a fast rule about that. Children have a way to pick from what is happening around the house and so if the father or mother has a positive attitude and does a particular thing, the children at home follows that too likewise if they see the parents with bad attitude. Parents who are knowledgeable about this try as much as possible to showcase good attitude to the children or in the presense of the children while they could do other negative attitude slyly where the children won't observe that.
In other words, show a positive attitude to the children so that they won't be exposed to the societal ills on time or vices around their environment, they can learn and choose the way to behave and react or act when they are adults. Fathers who are gamblers always end up having sons who follow his way of life at least one of the sons because they see him gamble too.
It's the same as the education that parents give their children. If they educate their children well, maybe their children will also do something of good value, but outside relationships are also determining because real education is outside relationships. but even so, I think all parents must teach the best for their children, it is impossible for parents to teach their children negative things. I think that only exists in films, not in real life. because as you said, with negative things they can do it secretly without their children knowing, and vice versa, when children are familiar with the outside world they can clearly see what is good and bad so there is a possibility that they will also do it. bad things secretly without their parents knowing.
Not all fathers who like to gamble want their children to gamble too, that's impossible for sure. I think even though the father likes gambling and has a son, they certainly don't want their son to also like gambling because that's not a good goal in life. Parents certainly want the best for their children, whether it's work, attention or affection. Also I think if you really like gambling then don't let our children find out about it. If the child becomes addicted to gambling then I think his parents have failed in educating him.