It is a likely mean to prevent their corruption, and the destruction which commonly follows it, as the next verse explains this.
Related Commentaries of Proverbs 23:13
Proverbs 23:13
13 Withhold not correction from the child: for if thou beatest him with the rod, he shall not die.