כִּֽי־יִהְיֶ֤ה בְךָ֙ אִ֔ישׁ אֲשֶׁ֛ר לֹא־יִהְיֶ֥ה טָה֖וֹר מִקְּרֵה־לָ֑יְלָה וְיָצָא֙ אֶל־מִח֣וּץ לַֽמַּחֲנֶ֔ה לֹ֥א יָבֹ֖א אֶל־תּ֥וֹךְ הַֽמַּחֲנֶֽה׃
S’il se trouve dans tes rangs un homme qui ne soit pas pur, par suite d’un accident nocturne, il se retirera du camp, où il ne rentrera pas.
Shaarei Teshuvah
“Be on your guard against anything bad” (Deuteronomy 23:10). They, may their memory be blessed, explained (Ketuvot 46a), “A person should not think [impure] thoughts by day and thereby come to impurity by night” - and even though his thought is not to [follow it up with action]. And it is something learned from its [context]. As after it, it is written (Deuteronomy 23:11), “If anyone among you has been rendered unclean by a nocturnal emission.”