Does the end justify the means is a constant persistent question. Chazal and later Meforshim dealing with problematic issues in Tanach have grappled with this issue and offered surprising approaches.
The well-known Ramban dealing with the Se’ir La’azazel (Vayikya 16:8) states: therefore they offered a bribe to Sama-el on Yom HaKippurim not to nullify their sacrifice, as the Passuk declares “One lot for Hashem and one lot for Azazel” Hashem’s lot is an Olah sacrifice and the lot of Azazel is the Chatas goat with all the sins of Israel on it.
The source for this remarkable statement is Prikei D’Rabi Eliezer (46) which the Ramban quotes verbatim. He then adds by way of explanation:
“But the Torah forbade completely acceptance of (angelic) divinity and any service to them. But HKB”H commanded that on Yom HaKippurim we send a goat into the desert to the prince (power) who rules over desolate places… Not that it should be an offering from us to it- heaven forbid- rather our intention should be to fulfill the wish of our Creator who commanded us to do so.”
Even with this formulation, it seems clear that the underlying purpose is to appease or at least distract Sama-el.
The Chizkuni presents a similar approach, much more succinctly: “one lot for Azazel (i.e. Sama-el) and in order that he not nullify their sacrifice we give him a bribe”.
In Rus (ch. 3) we find that Na’ami instructs Rus as follows:
“And you shall bathe and anoint yourself and dress (in your finest) clothing and go down to the threshing floor; do not make yourselves known to the man (Boaz) until he has finished eating and drinking. When he lies down take note of the place where he lies and go and uncover his feet and lie down and he will tell you what you should do”
The Alshich comments:
“Before Naami revealed her plan to Rus she explained certain matters to her (namely) that all holy matters cannot endure without having some admixture that appears to be sinful, even if it’s not actually forbidden. For example, Yaakov married two sisters, even though in his time it was not forbidden, the Torah would prohibit it. Nonetheless, his intent was pure in order to bring forth the twelve tribes of Hashem. Similarly Yehuda and Tamar even though (their relationship) involved the Mizvah of Yibum; nonetheless, the angel who directed Yehuda to join with Tamar so that from them would issue kings and prophets, did not inform him (Yehuda) that this woman was Tamar and that he would be fulfilling the Mitzvah of Yibbum. Rather the angel wanted him (Yehuda) to come unto her not in an act of marriage so that there should be attributed to their relationship something improper.
“Similarly, Naami spoke to Rus and explained- please know that the entire House of Israel depends on this pairing. For you are the woman from which will be revealed the light of Mashiach in the world. Ever matter which is extremely holy necessitates that it be mixed with some element of sin. Just as it is not possible to eat very sweet things without mixing in a little which is bitter and only then will it be palatable. This I have made known to you from Yehuda and Tamar.
The Igeres Shmuel on Rus (by the same author of the better known Medresh Shmuel on Pirkei Avos) writes in a similar vein:
All the commentaries wonder at the contrivance of Naami who advised Rus to act in a manner lacking in tznius and with brazenness, which has no place in a proper Jewish woman. One can explain, based on the fact that when the soul of Meshichan Shel David descends into the world there is always interference by Satan and the Sitra Achara. The strategy against him is to cloak (the pure) soul with a filthy and lowly garment, so then he will not sense what is transpiring, Satan will take pleasure in the garment and not touch the essence. We find this in various places:
Lot had relations with his daughters from which issued Moav and the family of Rus. Yehuda had relations with Tamar from which issued Peretz, a forbearer of David. Similarly, Yaakov married two sisters, all this was a ruse to conceal from the eyes of the Satan the greatness of the holy Neshama of Mashiach, and to ailence him with these very deeds with which he is appeased and demands, as with the Seir Hameshtaleach on Yom Kippur, to silence Satan. Since Nami knew that from this pairing would come forth the root of Yishai; therefore, she offered this advice to Rus, to conceal the matter from Satan.
In Megillas Esther, Mordechai instructs Esther to go Achasveirosh to plead for her people. Esther finally acquiesces with a final plea of “Ka’aasher Avadti Avadti”. Rashi comments based on the Gemara in Megillah (15a), “As I am lost from father’s house, I will be lost to you. For I am submitting willingly to a gentile to and will be forbidden to you. The Targum explains that just as I was taken from you against my will, so I will lose life in the world to come, for the salvation of the House of Israel.”
Esther is asked to make the supreme sacrifice on behalf of the Jewish people, to voluntarily go to Achashveirosh and be lost to Mordechai forever (or according to the Targum to give up eternal life). With such grave consequences, it is clear that what Esther was doing was clearly wrong; yet, at the same time both Esther and Mordechai understand that the salvation of the Jewish people is the greater good that must be realized.
There are many lessons to be derived from this. We live in a world of “Ohr Vechoshech Mishtamshim Beirbuvya, where light and darkness serve in a chaotic mixture”. Where the light and darkness both vie for supremecy and we are bidden to negotiate our way through the corrosive maze. When the end justifies the means and when it does not remains an eternal question.