Having a focused goal, a directed project of some sort, leads to doing more constructive things in an area that needs constructive attention. Having no particular good goal usually leads to no particular good result. It is a matter of human nature that we like to tinker. Even as kids we take things apart and hope that we can put them back together - or that Dad can do so for us. It is a matter of human nature to analyze and understand, but it sometimes goes wrong.
People cannot leave well enough alone. They tinker. The more free time they have on their hands, the more they tinker. This is part of the "if it ain't broke, don't fix it" mantra, to stop people from tinkering on something that is working and to offer the corollary - if it is broke, fix it. When people tinker, sometimes they make things better. Sometimes they don't. The cartoon and TV sitcom meme about "Dad tried to fix the sink but we had to call the plumber to fix what Dad did" originates from this concept.
There is also the idea that adolescents who aren't busy doing homework or chores have time to play pranks on each other. They get into squabbles, sibling rivalry, or youth gangs. Which is why neighborhoods desperately want ways to put kids into organized sports so that they don't get into more organized but less law-abiding gangs.
I will point out that the "anti-idle" admonition in any of its forms is based on observation. Perhaps we don't know why it is true - but we have known it to be true for a long enough time that Chaucer wrote about it centuries ago.