That is very true @Op parents need to be at alert in raising their children, but the fact is that parents alone cannot raise their children. in the concept of nature-nurture controversy, the possibility of a child learning more from nature is greater than the possibility of a child learning from nurture controversy(parents). it is quite obvious that even the teachers cannot raise the children well but the irony of it here is that the child spent more of his or her time with peer groups, teachers both in schools, churches, and even at home. so, environments play a major role here.
And that's why if they are in a bad company, they'll adopt the bad attitude of those people that surrounds them. As parents, we need to guide them and still teach them to what to do is right whenever we're not with them and wherever they go.
They're going to bring that teachings until they grow up and they'll know who to be with and who to flee from.
We have no control over the environment that they are in but we can protect them through guidelines and they will listen if we raise them properly.