"Where there is no vision, the people are unrestrained, but happy is he who keeps the law"
This is really the follow-up idea or linked idea from the Proverb 29:17 verse. All people – and not just children – need to be instructed about the positive behavior that is expected of them.
The word vision here is the word revelation or the clear command of God that cuts through the fog of life and says that this is what you should do. When that is not present in the minds of the people, they do not know when to say no and when to say yes. They are unrestrained and move off into evil.
It is incredibly crucial that the moral law – the Ten Commandments – be regularly and consistently taught as the proper moral boundaries for behavior. You cannot love God when you are worshiping other gods or represent Him with an image or use His name in vain or forget to worship Him. And you cannot be said to be loving your neighbor if you dishonor God-given authority, murder, commit adultery, steal, lie, covet. It must be really clear where the lines are. They must be imbedded into our heads.
In other words, just as the child must be clearly corrected, instructed, and trained with truth or they will not be delightful to their parents, so people in general must understand God's law and be trained in it or they will not be delightful to themselves or each other or to God. The civilization will begin to crumble and fall apart.