That's because a child only sees and imitates what his parents do so it makes us as parents be careful when in front of them. We must be able to set a good example so that they see and imitate it for their future provision. If we can set a good example for them, they will surely understand and be able to distinguish what they can and cannot do. This will also prevent their children from doing something bad when they grow up. Children need the understanding to understand things so this is what makes us have to be able to explain everything properly and correctly.
Parents have their own choices but I am sure that parents do not want their kids to follow what wrong they do or did in their life.
Like if a father takes drug he would beat his son to death if he finds out his son is doing the same. Likewise - if the parents are addicted drinker they would not want their kids to do that, Having gambling trait in DNA is not correct - its a choice.
As much as possible, parents want their children to have a better life, so they try to give their children the best.
But unfortunately, many of their children do not realize it and even misunderstand their parents' intentions.
Maybe this needs further understanding and discussion between parents and their children so that they can accept what the parents mean.
But their children still have their own choices in determining their lives and parents cannot impose their will on their children.