means that
inactivity can create opportunities for mischief or harmful behaviour; the saying encourages purposeful occupation.
When idle people, who have nothing to do are more likely to get into trouble or do a mischief., the saying “The devil finds work for idle hands to do” is appropriate.