The Norwegian dictionary [1] suggests that the expression "lediggang er roten til alt ondt" stems from a merging of two older expressions: "Otium est pulvinar diaboli"/"idle hands are the devil's workshop" and 1 Tim 6,10 "For the love of money is a root of all kinds of evil"
Wiktionary [2] refers to St. Jerome
> Proverbs 16:27 may have inspired St. Jerome to write in the late 4th century: fac et aliquid operis, ut semper te diabolus inveniat occupatum, or “engage in some occupation, so that the devil may always find you busy.” This was later repeated by Chaucer in the Canterbury Tales, which was probably the source of its popularity.
[1] https://naob.no/ordbok/lediggang
[2] https://en.m.wiktionary.org/wiki/idle_hands_are_the_devil%27...