May one fly an American or Israeli flag?
Being patriotic for one’s country: The Mishneh states that “Mispalelim Leshilom Malchus,” that one must pray for the peace of his country. Indeed, in living with this statement, Jews throughout the generations served as noble patriots of their countries, fought in their battles, assisted them in their challenges, and prayed for their well-being. The Rebbe Rashab in fact wrote a public letter in 1917 encouraging the Chassidim and general Jewish populace of Russia, to assist the Russian government in battle and fight in their favor. This followed the footsteps of the Alter Rebbe in his day, who supported the Russian monarchy in their battles and wars. Nonetheless, despite this Torah perspective of patriotism to one’s native country, the question is raised as to the attitude that one should have towards the flag of the country and as to whether it may/should be flown in a Shul and the like, in public display of one’s patriotism.
The philosophical view on the Israeli flag: Naturally, the attitude of Judaism towards the Israeli flag is affected by one’s sect’s viewpoint on Zionism in general. Amongst orthodox Jewry we find many different spectrums of perspectives on Zionism, with [what some would call] the far right who sanctify the state and the Zionistic appeal as holy and enshrined according to Torah [i.e. Mizrachi, Daati Leumi, Religious Zionists, Modern Orthodox], and the far left which opposes the Zionistic appeal and oppose the state as something absolutely contrary to Torah and Judaism [i.e. Satmar, Yishuv Hayashan of Jerusalem and others]. Many sects Chareidi Jewry take a middle approach which is not proactive for Zionism, but does not voice active opposition, and participates in state affairs [i.e. Agudas Yisrael]. The Chabad approach is perhaps the most interesting, being plausibly the most philosophically opposed to the original ideals of the Zionist appeal, but at the same time adapting to the facts on the ground and being in support of all the endeavors that benefit the State. Naturally, Chabad receives pushback from both the far left for “abandoning” its true philosophy and becoming “Zionistic,” as well as the far right for being a masquerade and hiding its true thoughts under a cloak of activism for the State. In truth, Chabad fully believes in both respects, the need to oppose Zionistic appeals which are contrary to Torah and Judaism, and the need to support the material and spiritual benefits of the Jews living in the State irrelevant to their philosophical beliefs. This is not something new to our generation, but even in the times of the Rebbe Rayatz, he opposed those who used their anti-Zionist theologies to spread hatred for their fellow Jews, and despise “Zionists.” In one letter in 5709, he writes [in response to an individual who wrote that he will not visit Israel due to the Zionist elements found there, “From which Cheder were you educated in this level of Sinas Yisrael.” Whatever the case, it is understood that the attitude towards the Israeli flag which is representative of the State is affected by the above philosophies of one’s group. Some absolutely oppose it, others absolutely embrace it, and others take a middle approach to do according to what’s commonly accepted in one’s community. So while they do not contain a Zionistic fervor to desire to fly their own Israeli flag, they do not make ruckus if it is done, and certainly do not make issue out of it that can make them become despised upon their community. [While Chabad as a policy does not fly the flag by their official institutions, some Shluchim in Israel indeed place an Israeli flag by their Batei Chabad on Yom Hatzmaut in order to show solidarity and maintain peaceful relations with their congregants and members of the city, and not offend them. This is part of their endeavor to help support the physical and spiritual embracing of their fellow Jews. Famously, the Ponvicher Yeshiva in Bnei Brak has a decades long tradition to fly the Israeli flag on Yom Hatzmaut as a sign of solidarity for the country.] Rav Moshe Feinstein in a responsa writes a most balanced and viable approach. On the one hand, he agrees with the sentiment that the Israeli flag was founded by Reshaim [i.e. people who were not religious and actively desired to replace the religion of Judaism with secular nationalism], and therefore it would be best to uproot the flag entirely, nevertheless, there is no inherent prohibition in flying the flag as a sign of support for the State of Israel. Whatever the case, Rav Moshe concludes with the following very wise words that should be implemented and followed: “Despite the above ideal opposition to the flag, it is forbidden to make a Machlokes over it….and therefore those people who desire to make a break off Minyan because they oppose the current congregations use of the Israeli flag, and they think they are doing a great thing through doing so, in truth they are doing something improper, and its simply politics which comes from the side of the Yetzer Hara and Satan which due to our many sins is dancing amongst them. May G-d have mercy on them and send us the righteous redeemer and arouse us that we go in the correct path without swerving to the left or to the right.”
The philosophy on the American flag: While some have voiced opposition to flying the American flag due to its picture of the eagle, practically, there is no Halachic issue in doing so, and it is permitted to do so to show one’s patriotism to the great country of America which has given millions of Jews a place of safe refuge for generations.
Flying the flags in a Shul:
 Pirkei Avos 3:2 “Rebbe Chanina Segan Hakohanim Omer: Havei Mispalel Beshlomo Shel Malchus”
 In the early 1900’s it was the widespread custom in almost all Shuls in America to recite a Mi Shebeirach for the USA; See Igros Kodesh Rayatz 13 p. 358 for a Nussach Tefila that the Rebbe Rayatz authored to be recited on Rosh Hashanah in all Shuls on behalf of then president Roosevelt, and the United States of America, that G-d help them in world war 2.
 Letter of Rebbe Rashab written to Russian Jewry in 1917 while in Rostov, during the Russian revolution, printed in Chamei Yisrael Besht, p. 57-59. The following are some excerpts from the letter: “We are citizens of the land just like all the other citizens and thus…it is a Mitzvah and obligation to benefit our country. We should place our hearts and soul for the betterment of our country and help save it in battle…I am assured that our brethren will show their loyalty and patriotism to their birthplace.”
 Regarding the History and design of the Israeli flag: See Kitzur Shulchan Aruch with notes of Rav Shlomo Aviner [a leading Religious Zionist Rabbi] p. 339-340 that the aid of Hertzel, names Woldson, writes in his memoirs that it represents the Tallis with an added star of David, and that it was personally chosen by Hertzel.
 See Kitzur Shulchan Aruch with notes of Rav Shlomo Aviner [a leading Religious Zionist Rabbi] p. 339-340 who summarizes: The flag of Israel does not contain any holiness and does not need to be kissed or placed in Geniza if it became worn out, although it should be respected.
 See letters of the Rebbe Rayatz in the Sefer Chamei Yisrael Besht, as well as in the Sefer Tikkun Olam of Rav Moshe Goldstein
 See https://chabadinfo.com/exclusive/israeli-flags-at-chabad-events/ for a response of the Rebbe on this matter: “P.S. Regarding what you wrote about the fact that Israeli flags were not waved during the abovementioned parade, and asked what the reason is. You are surely aware that there is a directive to all Chabad Askanim and activists to try to spread Judaism, Torah and Mitzvos as much as possible, to all Jews without involving any politics or partisan affiliations, and definitely not to get involved in aspects of Machlokes, or anything else which might prevent someone from adding Torah and Mitzvos – You are surely aware that there are various groups that, for various reasons, will not participate in a Lag Baomer parade where an Israeli flag is waved, and why should we alienate many Jewish children [from participating]?” See also the Sefer “Madrich Tochnit Havoda Legil Harach”, written by Chabad author Rachel Zamir with a blessing of encouragement from the Rebbe, that on Yom Hatzmaut one should show the children the Israeli flag and explain to them about the day. Obviously, this statement cannot be said to receive the Rebbe’s approval, although is an interesting perspective of a Chabad approach.
 This can likewise be interpreted to be in line with the Rebbe’s position as he wote in the previous footnote
 Igros Moshe 1:46
 See Kitzur Shulchan Aruch with notes of Rav Shlomo Aviner [a leading Religious Zionist Rabbi] p. 339-340 who writes that he received in the name of the family of Rav Moshe Feinstein, that he regretted using this term, in the letter. Practically, the letter speaks for itself and the rumor has yet to be authenticated by a living family member.
 Igros Moshe O.C. 1:46 regarding both the American and Israeli flag that there is no inherent issue in flying them; Igros Moshe Y.D. 2:55; See here for further details on the prohibition of making and owning pictures/sculptures of animals, and when it applies