While each of the kashrut rules has its own reason, in general they are meant to separate the Jews and sanctify them, as we read, “I the Lord am your God Who has set you apart from other peoples. So you shall set apart the pure beast from the impure, the impure bird from the pure. . . You shall be holy to Me, for I the Lord am holy, and I have set you apart from other peoples to be Mine” (Leviticus 20:24-26). The Sages widened the application of this principle and prohibited bread baked by non-Jews, food cooked by non-Jews, wine produced by non-Jews, and milk milked by non-Jews. These rules apply even when all the ingredients are kosher.
True, there is a mitzva to care about all people regardless of race or religion, and it is the Jews' mission to draw down blessing upon all nations. (Abraham was promised in Genesis 12:3, “All the families of the earth shall be blessed through you.”) Nevertheless, to enable the Jewish people to bring blessing to all, they must establish “a kingdom of priests and a holy people” (Exodus 19:3-6) by dedicating themselves to Torah study and mitzva observance. This allows divine light and inspiration to spread throughout Jewish life, and subsequently to all people. To facilitate this, the Jewish people must preserve their uniqueness, putting up fences to prevent their children from assimilating and forgetting their mission. Since eating and drinking form bonds between people, the Sages enacted ordinances designed to separate Jews socially from non-Jews. When Rabbi Zvi Yehuda Kook talked about these rules, he always emphasized that “Separation is not dissociation.” He added that when this idea becomes well-known, the redemption will arrive. Understanding the need for separation without dissociation allows each individual and each nation to develop its uniqueness in a moral way, without demeaning others or damaging the good relationships which should prevail among all people.
Unfortunately though, sometimes it is not enough for Jews to simply separate respectfully from other nations. If nations or societies choose evil, we must dissociate from them and reject them completely. For this reason, the Sages strictly prohibited drinking (or even benefiting from) wine touched by an idol worshiper.
All the prohibitions on food prepared by non-Jews are meant to accomplish these two goals: to create an arena for the Jews to flourish and develop their unique character, or to distance the Jews from extraordinarily wicked cultures.