expresses the belief that
having nothing constructive to do may encourage mischief or harmful behaviour.
similar
Idleness is the root of all evil. The devil finds work for idle hands to do. An idle brain is the devil’s workshop.
When it is more likely to do something bad when you have nothing to do;, the saying “Idleness is the mother of all evil” is appropriate.