Yes you are right but the time they need to choose between what you as a parent thought them and what they learned from others is when this have reached the age of 18. But while they are below that age, they need to obey the rules given to them by their parents. However, it's true that we can no longer hide gamble from children because if the way their are now, everyday more advertises in social media about casino and when a child is beginning to see some of these things, his attention will be divided from what you have thought them. This is also the same reason why parents need to lecture their children about hard drugs and gamble, so that they will know the dangers on it.
From a tender age, if the parents keeps reminding the child whats good and bad and teach them the right part on how to be discipline i don't think such child can easily forget the teachings of the parents. Though peer pressure can sometimes change the reasoning of the child and compel them to do things against their will, but in no time if they aren't corrected, they'll end up following those route and assume that to be normal. As parents or guardians its important to expose your kids on the demerits of those things rather than hiding it from them. If they eventually learn the wrong things from their friends they might keep it a secret from you and with time it will become a habit. Teenage children are the most difficult to control because the joy of becoming an adult is overwhelming to them and they feel they can be independent in making some decisions, but trust me if a parent give up on their children based on attitudal changes, the child might end up becoming their worst nightmare.