The Ramban noted that the Mitzva given to Moshe in Egypt regarding Rosh Chodesh, was the first commandment given from G-d to Moshe. This was in addition to the instructions related to the first Seder, celebrated in Egypt.
All of the rest of the Mitzvot, were given on Mount Sinai.
The Ramban makes a point of saying that these commandments were given חוץ לכרך, outside of the city. The decadence and impurities were so great that a revelation from Hashem, had to come in an unpolluted area. This is a reminder that we cannot experience spirituality in an unholy environment. We must remain separate from all negative influences, in order to grow in holiness.
The Torah Yeshara, a biblical commentary by Rav Yechezkel Kahane, father of Rav Meir and Rav Nachman, makes a similar point. He said that Moshe said the following to the Jewish people. “As deliverance from Egypt is to be not only from physical bondage, but also from spiritual slavery, you must break away from Egyptian influence altogether.”
There are many reminders of this idea as expressed in connection with living in Israel. The Talmud speaks of the holy air of Eretz Yisrael, and how only in Israel can one truly flourish. The Keli Yakar makes an even stronger statement. He says that one can only observe eight of the Ten Commandments, in Chutz L’aretz. This is because one who dwells outside of Israel, it’s as if he has no god. Therefore, he cannot fulfill the first two of the ten, “I am the L-rd Your G-d,” as well as, “You shall have no other gods before Me.”
The influence of Egypt was extremely negative. We must get the message and actively put ourselves in the best place for spiritual growth. Living in Israel, is a good start.