The Gemora states (
Daf Yomi: Sotah 12b): And his sister said to Pharaoh’s daughter, “Shall I go and call for you a wet-nurse from the Hebrew women?” The Gemora asks: Why was it necessary to summon a Hebrew woman? The Gemora answers: This teaches us that they handed Moshe to all the Egyptian women, but he would not nurse from them. He said: “Shall a mouth that is destined to speak with the Shechinah nurse from something which is not kosher?”
The question is asked: Why does the Gemora state this reason with respect to Moshe, when the halacha clearly rules that all Jews must refrain from having an idolater nurse their child, if a Jewish nurse is available (Rama Y”D 81:7)?
Maharatz Chayos suggests that this halacha only applied after the Giving of the Torah, for then many of the foods consumed by non-Jewish women are forbidden to Jews. Since this reason was not applicable to Moshe in Egypt, it was necessary to provide a different explanation for his refusal to be nursed by an Egyptian woman.
Shulchan Aruch rules that a Jewish baby is permitted to have a non-Jewish wet nurse; however it is not preferable because the non-kosher food will harm the baby spiritually. The Rama adds that a Jewish woman who must eat non-kosher food for health reasons should not nurse her baby because the non-kosher food will be detrimental for the child.
The Gra cites our Gemora that Moshe refused to nurse from an Egyptian woman because he was destined for prophecy, so it would be improper for him to consume non-kosher food. It would seem that the non-kosher food would have affected his soul, and disqualify him to be the Prophet that he became.
Reb Micha Berger gleans from here that non-kosher food is intrinsically harmful for a person’s soul even if it is permissible to eat.
He cites a Ran in his Drashos (11) that states this explicitly. In his discussion as to why halacha is decided by the Chachamim and not by the Prophets, he asks the following question: If a sage errs and permits a forbidden food, it is like a doctor who makes a mistake and gives a patient poison instead of medicine. In both cases, the person is harmed. Accordingly, wouldn’t it be preferable for the Prophets to decide halachic matters, and then, there would be no mistakes?
He answers that prophecy is not always available. He then adds that even though eating non-kosher food is harmful, the mitzvah of listening to our sages may offset the harmful effects. It is however evident from the Ran that the consumption of non-kosher food is objectively poison, and detrimental to one’s soul even if it is done permissibly.
The Abarbanel (Devarim 17:4) disagrees with the Ran. He maintains that it is impossible for harm to befall a person if he is following the Chachamim. If the food is permitted, it cannot be harmful. Reb Micha explains that it would seem from the Abarbanel that he maintains that the consumption of non-kosher food is not intrinsically harmful; rather, it is harmful only because it is prohibited. If for some reason, there is no prohibition, then it is not harmful.
Reb Moshe (O”C 2:88) quotes the Chasam Sofer where he was discussing a handicapped girl in the following situation: If she would remain at home, she would not develop properly and remain ignorant her entire life. However, if the parents would send her to a special school, they claimed that she would then reach the potential of a teenager. However, the school was in a non-Jewish area, and there was no possibility of providing kosher food. The Chasam Sofer ruled that it is permitted to send her there, but he recommended against sending her, for the following reason: If they send her to that school, she will become intelligent enough to be obligated in mitzvos. The non-kosher food that she will consume will affect her heart, and she will probably violate Torah and mitzvos. It is therefore preferable for her to remain in her present situation. (He concludes: Her present situation is more preferable than being “b’timtum” before the Holy One, Blessed is He for one moment.)