Imagine you have two teams to choose from: a team that's always slacking off and making a mess, and a team that trains every day, helps their teammates, and tries to improve. With which team will you improve more? With the champion team, right? Because we learn from whoever is by our side.
The Bible says the wise child pays attention to their dad's rules (they have discernment). But the child who walks with "gluttons" ends up just the same. That's why it's so important that your friends are people who do good, who are honest, and who love God. Jesus said that whoever does God's will is part of our family!