I. Sinning for a Mitzvah
Purim is an odd holiday in that one of the heroes of the day lived in sin for most of her life. I am speaking, of course, about Esther, who was married to the Persian king Achashverosh). While a careful review of the language of the book of Esther shows that she was repeatedly taken, i.e. against her will, there is one instance in which she went to Achashverosh willingly (Esther 4:16):
ובכן אבוא אל המלך אשר לא כדת וכאשר אבדתי אבדתי
And so I will go to the king, which is against the law; and if I perish, I perish!In order to give Achashverosh the message about Haman's plot to kill the Jews, Esther had to voluntarily go to Achashverosh. According to talmudic tradition (Megillah 15a; cf. Rashi sv. avadti mimkha), going to him to deliver this message entailed willingly sleeping with him. How was this permitted if a Jewish woman is forbidden to sleep with a Gentile? She presumably followed the example of Yael who, according to talmudic tradition (Yevamos 103a), slept with Sisera the Canaanite general in order to kill him (Judges 4).
This is what can be called an "aveirah li-shmah -- a sin for the sake [of Heaven]". R. Chaim Volozhiner (Keser Rosh) held that this can only be used to justify an act that will save the lives of all (or, presumably, many) Jews, although R. Hershel Schachter (Be-Ikvei Ha-Tzon, ch. 3) brings a number of authorities who implicitly disagree and expand the permission. Regardless, all authorities seem to discuss the issue of a single act of sin for a mitzvah purpose. I am wondering what they would say about years of constant, intentional sinning over a number of years for a mitzvah purpose.
II. Spies
Readers might remember Eli Cohen, the Israeli spy who provided invaluable intelligence and probably saved thousands of Israeli lives (link). He lived in Syria as an Arab for about 4 years in the 1960s until he was captured. Regardless of his personal religiosity, I was wondering whether it would be permissible for a religious Jew to become an undercover spy and live an irreligious lifestyle -- eat non-kosher food, violate Shabbos and Yom Kippur, etc. -- for years in order to save lives. He would most likely have to even eat non-kosher food on Yom Kippur in order to maintain his cover.
It seems like an unlikely thing to permit, but Israel needs spies. R. Zekhariah Ben Shlomo discusses the issue of intelligence gathering in chapter 100 of his Hilkhos Tzava. He points out that Israel's enemies attempt to take advantage of Jewish holidays and therefore intelligence gathering must continue on Shabbos and holidays. Additionally, low-level intelligence gatherers cannot know the importance of even seemingly small and unimportant pieces of information. The importance can only be known when all the pieces are put together in a central location. Therefore, while he feels unworthy of writing comprehensive guidelines of intelligence gathering and halakhah, as a matter of principle he accepts that it generally overrides Jewish laws because it can save lives.
III. Living the Life
However, I can see a distinction made between individual acts and living an irreligious life for years. For example, when food must be prepared for a sick person on Shabbos, the Ran rules that it is better to slaughter an entire animal than to have the sick person eat a little non-kosher meat. Why? Wouldn't it make sense to prepare a little food rather than a lot? The Ran explains that slaughtering an animal is a single prohibited act while eating non-kosher food involves multiple prohibited acts. One violation, even of a severe prohibition, is better than multiple violations of a less severe prohibition.
It seems to me that living a completely irreligious lifestyle is not just quantitatively worse than a single violation but is qualitatively worse. It involves removing oneself from a religious environment that can permanently change a person's habits and attitudes. However, on the other hand, Israel needs spies.
I spoke about this with a local rabbi, R. Yisroel Hirsch, and he thought that it is clearly permissible. However, he added that the details of who can take such an assignment and under what circumstances is among the complex questions that the modern state of Israel raises and that few if any today are able to answer.
Does anyone know of anyone formal or informal halakhic rulings on this topic?