Good Thoughts are Part of Worship
Every little action adds up. What is the objective of being told to keep yourself free of bad thoughts? It is so we can occupy ourselves in good thoughts by using our time productively. It is so we can prevent our brain from wandering off and use those good thoughts as worship.

