I am looking for a phrase in the Bible that is similar to the saying, "an idle mind is the devil's workplace."
In warning churches not to support young widows, Paul stated, "And besides they learn to be idle, wandering about from house to house, and not only idle but also gossips and busybodies, saying things which they ought not' (I Timothy 5:13). People with time on their hands will tend to use that excess time in a non-productive manner. Such happened in Thessalonica, "For we hear that there are some who walk among you in a disorderly manner, not working at all, but are busybodies" (II Thessalonians 3:11).
Solomon warned, "He who is slothful in his work Is a brother to him who is a great destroyer" (Proverbs 18:9). Sloppy or careless work is no different than wanton destruction.
These all speak toward the productivity of our hands, but not our minds. There are warnings against idle talk.
"Now the purpose of the commandment is love from a pure heart, from a good conscience, and from sincere faith, from which some, having strayed, have turned aside to idle talk, desiring to be teachers of the law, understanding neither what they say nor the things which they affirm" (I Timothy 1:5-7).
"O Timothy! Guard what was committed to your trust, avoiding the profane and idle babblings and contradictions of what is falsely called knowledge -- by professing it some have strayed concerning the faith" (I Timothy 6:20).
"But shun profane and idle babblings, for they will increase to more ungodliness" (II Timothy 2:16).
It is the last which I believe is closest to the source of what you are looking. "Profane" refers to things that are corrupt or polluted."Idle" in this case refers to useless things, things empty of content, or unproductive things. Examples can be found in Titus 3:9, "But avoid foolish disputes, genealogies, contentions, and strivings about the law; for they are unprofitable and useless." Many people get wrapped up in silly arguments regarding things that cannot be settled because the information is not presented to us in the Bible. People take these gaps as opportunities to fill them in with their own speculations. For example, I have had person argue at extreme length about the location of the Egyptian boarder at the time of the Exodus. While the location might be of curiosity, especially if you are looking to do archeological digs, it certainly isn't a matter of grave importance. Yet from this trivial point comes all sorts of conclusions which contradict the teachings of the Scriptures. Starting with something not mention, a whole belief system is created. Since its foundation is in speculation and not the Scriptures, it produces many false ideas.