Rambam (Moreh Nevuchim 3:8): It is a well‑known saying of our Sages (Yoma 29a) that the thoughts about sinning are more harmful than the sin itself.” I have a very good explanation of this. When a person transgresses or is disobedient it is typically because of accidents or physical lusts that are characteristic of his animal nature. However the power of thought is his most elevated aspect and is actually an aspect of the human essence. Therefore a person who sins in thought sins by means of his most elevated aspect. There is no comparison of the severity of sin of someone who wrongly causes a foolish slave to work as he who wrongly causes a distinguished free man to do the work of a slave…Therefore this gift of thought which G‑d gave to us in order to perfect ourselves and to learn and to teach must not be used in doing that which is the most degrading and disgraceful aspect of ourselves. We must not imitate the songs and stories of the foolish lustful nations of the world which are suitable for them but not for us - the kingdom of priests and a holy nation (Shemos 19:6). Therefore all those who utilize the faculty of thought or speech in matters which are disgraceful to us, or who thinks more than necessary about drinking or sexual relations or who gets involved in singing about these lowly things – is taking and utilizing divine gifts in rebellion against G‑d and His commandments.