Halachipedia writes on the prohibition of food cooked by non-Jews (Bishul Akum)
There are a number of reasons for this gezeirah. The opinion of Rashi is that chazal wanted to prevent socializing with non-Jews, which might lead to intermarriage (chasnus). Rashi in Meseches Avodah Zarah says that we are concerned that if the Jew often eats the non-Jew's food, the non-Jew might later serve a non-kosher food item to the Jew. Most poskim agree with the first reason.
If the accepted reason is to prevent intermarriage, should there not be another prohibition, that is a Jew should not cook food for a non-Jew which equally might lead to socializing with non-Jews, and intermarriage? Let there then be a gezeirah on Jewish people not to share their food with non-Jews?