‘After the doings of the land of Egypt wherein you dwelt you shall not do and after the actions of the land of Canaan to which I shall bring you, you shall not do; neither shall you walk according to their ordinances. You shall do My Judgments-mishpatim [social laws] and keep My ordinances- chukim (Vayikrah18: 3-4).
The Midrash (Vayikrah Rabbah, chapter 23) explains that the Egyptians were steeped in sexual immorality, and the land of Canaan was replete with immorality and witchcraft.
Now both countries were indeed filled with immorality and idolatry that is witchcraft. Regarding Egypt we read about the nakedness of the land (Bereishit, 42:12) while we are told that their flesh is the flesh of donkeys [a euphemism for homosexuality]; and their witchcraft was infamous so that Hashem declared that He would render judgment against their gods- sorcerers. ‘For in all these- [incest, homosexuality, bestiality]- the nations of that land [Canaan] are defiled which I cast out before you’ (Vayikrah, 18:24). Our sages tell us that there was not a mountain nor a hill in Eretz Yisrael where the Emorites- Canaanites did not worship idols. Though the 2 nations were similarly sinful, nevertheless the Egyptians primary pull was towards immorality while the Canaanites were a stronger force leading to idolatry. The MaHaral writes (Gevurot HaShem) that the Egyptians were material [chomer] while the Canaanites were form [tzurah], both of them in a disoriented perverted way. Now the mind is the form relative to the matter, so that the idolatry was a product of their wisdom and minds albeit a perversion. ‘ In the days of Enosh (Bereishit, 4 26), Mankind’s idolatry was caused by their intellect and minds which judged that it was for the King’s -G-d’s honor that people should worship His servants [the forces of nature]. It was their minds that led them to this evil'(Mishneh Torah, Hilkhot Avodat Cochavim, chapter 1, halakhah1h). The Egyptians being matter were more steeped in sexual perversions and immorality, a distortion of the natural and the material; ‘Even as their actions are animalistic’ (Sotah, 14a). [The Shem Mi Shmuel writes that he dealt extensively with this matter since he saw that others had written the opposite, yet he held that his presentation is in accordance with Chazal].
The conclusion of the verse, ‘You shall do My judgments and keep My ordinances’, is meant to counteract the actions of the people of Egypt and of Canaan. The Mishpatim [social laws are products of the mind and the intellect, as Rashi points out that if the Torah had not commanded them Mankind’ wisdom would have led them to these laws. Therefore, they come to cure and purify the minds that had been perverted and falsified by the Egyptian induced errors of idolatry. On the other hand sexual immorality is a question of social mores and customs of a society. This is as the Ramban explains (verse 6] that intellectually there is no such thing as proper marriage and improper laws of sexual relationships; incest, for instance would seem to be a logical way to make certain that property remained within the family. What prevents immorality are simply the social rules of that society; Hashem gave as chukim and rules that make for a moral sexuality. According to this, Israel’s observance of Hashem’s ordinances will cure and guard them from immorality in general and the perverted mores and sexual immorality in particular, of the people of Canaan.
Because of the tendency of the Egyptians to idolatry and the power of sexual immorality of Canaan, the 2 verses follow each other, with the Mishpatim, against errors of the mind [Egypt ] and then Chukim, providing against the behavior of Canaan to which they were destined to come.
When they entered Eretz Yisrael, they needed to have the means of conquering these same 2 forms of yetzer harah- idolatry and sexual immorality, propagated by the Canaanites. So Joshua was commanded to circumcise the males, mitzvah of milah, and to observe korban Pesach, that they had not been able to keep during their wanderings in the desert. These same 2 mitzvot had been given top them in Egypt, to similarly cleanse them; milah to cure them of sexual immorality and the Pesach against idolatry. The taking of the pascal lamb was an act of the mind, knowingly ‘draw your hands from idolatry ‘ while milah was a chukah to grant them correct mores and forms of behavior.
In Torat Cohanim, we read that we know that the living of Israel on the land of Egypt caused them to sin, because our verse reads, ‘The actions of the land of Egypt wherein you dwelt’. As the sins of Egypt multiplied they sought to infect Israel with them. However, as the Shem Mi Shmuel comments on Parshat Kedoshim  that G-d watches over Israel and leads them, He alone is their yetzer. While the yetzer harah infects Cain and his descendants with evil thoughts, Hashem inserts holy and pure thoughts into Israel. Despite this, the evil ones try with all their might to infect us. For this purpose, it is not even necessary for us to be interspersed among the nations in order for us to be influenced by their actions. Even when we live separate from them and in our own closed communities, the very air that we breathe is full of their immoral practices and evil actions. In the material world, if one breathes polluted and diseased air, one contracts illness and disease. So it is with spiritual matters; breathing in air contaminated with evil, infects the heart and distorts the mind, leading to unholy behavior and immoral mores. That is why it was the settlement of Israel in the land of Egypt that made it possible for the nations to stifle the hearts and minds with impure thoughts and unholy actions. In contrast the air of Eretz Yisrael is pure cleanses the mind and makes one wise.
Shem Mi Shmuel, 5674 5673.
Copyright © 2004 by Rabbi Meir Tamari and Torah.org.
Dr. Tamari is a renowned economist, Jewish scholar, and founder of the Center For Business Ethics (www.besr.org) in Jerusalem.