Immediately my mind jumped that this somehow violated the First Amendment. But analyzing this situation I have come to realize it simply does not.
The role of the First Amendment’s religions clause in America.
Governmental “institutions must not press religious observances upon their citizens.” Van Orden v. Perry, 545 U.S. 677, 683 (2005) (Rehnquist, C.J., plurality opinion). Even “subtle and indirect” pressures are impermissible. Lee v. Weisman, 505 U.S. 577, 593 (1992). The government can neither “persuade [n]or compel” people to join in prayer. Id. at 599. Government cannot bring to bear public pressure, nor lend its support to peer pressure, to join in prayer. Id. at 593. “[A]t a minimum, the Constitution guarantees that government may not coerce anyone to support or participate in religion or its exercise.” Lee, 505 U.S. at 587. The government can neither “force nor influence” a person in religious matters. Everson v. Bd. of Educ., 330 U.S. 1, 15 (1947) (emphasis added).
Clearly, the key to the First Amendment protection about religion is government action. In this situation, there is no government action which means the First Amendment does not apply since it is the church influencing, maybe even requiring, a patriotic act during a church service.
The question remains: should a church have a flag in church and do the pledge of allegiance during a church service?
To answer that question we must first look to the history of American flags being displayed in churches.
History of the American flag in churches
American history scholars agree that flags became more common in American churches during World War I. Those who refused to place flags in their sanctuaries were accused of being pro-German. When Herman Hoeksma, minister of a Christian Reformed church in Holland, Michigan, refused to put the flag in the sanctuary during World War I, he was reviled as a pro-German traitor and a Communist. One newspaper suggested that Hoeksma should be deported or shot. Another Dutch Christian Reformed minister in Iowa was run out of town, and had his church burned by vigilantes, for declining to display the flag. In the 1910s, Klansmen donated flags to southern churches and insisted that they be displayed in sanctuaries. During World War II and the fervent anti-communism of the 1950s, the failure to display flags in sanctuaries was considered un-American.
This brief history shows that historically to push to have the American flag displayed in church or risk bodily harm and run out of town.
There is still another difficulty in displaying the American flag in the place of highest honor during church worship. It is one of the oldest and most universal Christian understandings of worship that a mass is the spiritual gathering around the Lord's table for worship by everyone. The whole holy, catholic or universal Church (as that term is used in the Nicene Creed) is joined together at mass all over the world and in heaven. Is it not a denial catholic or universal Church to limit the mass to Americans who pledge allegiance to the flag? If, as the Nicene Creed tells us the church is global, even in its local manifestation, no statement, symbol, song or gesture should suggest limitation to a certain nation or people. The Bible speaks of Peter saying, “I truly understand that God shows no partiality, but in every nation anyone who fears him and does what is right is acceptable to him.” Acts 10:34–35. Emphasis added. In Psalm 98 God reveals his righteousness to nations not a specific nation swearing allegiance.
It is a rather narrow view of a catholic or universal Church to suggest God gives you a preferred place if you say pledge allegiance to the flag of a certain nation during mass. My memory of religious instruction did not indicate America having a special covenant or divine revelation from God. The Bible specifically rejects the idea that one people are to be considered God’s favorites when it states “there is no favoritism with God.” Romans 2:11; Ephesians 6:9. In fact, the Bible states “if you show partiality, you are committing sin.” James. 2:9
Saying this differently, displaying a flag and saying the pledge of allegiance during mass is a misguided nationalistic faith of the type found in found in America’s past. It is a behavior contrary to the Bible’s specific ban of partiality. An American flag used in the worship of the universal church is no more appropriate than hanging a cross in a civil courtroom.
 ENEMY ALIENS? WORLD WAR I AND DUTCH AMERICANS, https://origins.calvin.edu/2020/01/14/world-war-i-and-dutch-americans/; The history of the American flag in Missouri Synod Churches, https://concordiahistoricalinstitute.org/wp-content/uploads/2019/06/HF62_2_American_Flag_LCMS_Churches.pdf
 The Church and the American Flag, HTTPS://WWW.THEGOSPELCOALITION.ORG/BLOGS/EVANGELICAL-HISTORY/THE-CHURCH-AND-THE-AMERICAN-FLAG/