"Any man whose wife goes astray (tisteh)" (Numbers 5:12). Our Rabbis taught: Adulterers do not commit adultery until a spirit of folly (shetut) enters into them, as it is said, "Any man whose wife goes astray (tisteh)." We have learned this concerning the woman. Concerning the man, from where [do we know it]? As it is said, "One who commits adultery with a woman lacks sense (literally, lacks heart)" (Proverbs 6:32).
The Spirit of Folly That Enters Adulterers in Tanchuma Nasso
Midrash Tanchuma Buber, Nasso 7:1
איש איש כי תשטה אשתו. שנו רבותינו אין המנאפין מנאפין עד שתכנס בהן רוח של שטוות, שנאמר איש איש כי תשטה אשתו, למדנו לאשה, לאיש מניין, שנאמר נואף אשה חסר לב (משלי ו לב).