ANSWER: First, a little informative background. The basic phrasing for the modern allegiance pledge to America was created by a Baptist minister named Francis Bellamy in 1892. His twenty-three word vow, crafted to be brief so that it could be recited quickly, is the following.
After a few minor changes over the years, the modern Pledge was approved by the U.S. Congress and signed into law in 1954 by then President Eisenhower. According to the U.S. Flag Code, the below words of allegiance should be stated (for the majority of people) while standing at attention toward the flag with the right hand held over the heart.
"I pledge allegiance to the Flag of the United States of America, and to the Republic for which it stands, one Nation under God, indivisible, with liberty and justice for all."
The first issue we will tackle concerns flags. Are they, of themselves, wrong to create (let alone pledge to) in the eyes of God? Is there existence idolatrous and contrary to the second commandment (Exodus 20:4 - 5), especially when they are created to represent a group of human beings? God, a short time after giving the Ten Commandments on Mount Sinai, told the children of Israel to do the following.
1. And the LORD spoke to Moses and to Aaron, saying, 2. "Every man of the children of Israel shall pitch by his own banner (or standard to denote a particular tribe)b . . . " (Number 2:1, HBFV throughout)
The Hebrew word translated as "banner" in the above verses is degel, Strong's Concordance #H1714, which means a flag or a standard. They were used not only to represent an individual Israelite tribe but also a group of tribes. For example, the flag of Judah represented the three tribes of Judah, Issachar and Zebulon that were located on the eastern side of Israel's wilderness encampment after they left Egypt (Numbers 2:3 - 9). The flags of Ephraim, Reuben and Dan also represented a collection of three tribes (verses 10 to 31).
Jewish tradition, as well as several Biblical commentaries, state that Judah's flag had a lion on it, Ephraim's had a calf or ox (some think it was a unicorn), Reuben's had the face of a man and Dan's banner had an eagle on it (see Ezekiel 1:10, Revelation 4:7). God endorsed the Israelites possessing flags, with images on them that represented either an individual tribe or a collection of them.
The second commandment, which concerns idolatry, states that we are not to make anything that resembles what God has already made in order to bow down and worship it (Exodus 20:4 - 5). Only the true God is worthy of worship.
Notice that the focus of the commandment is NOT to forbid using creativity to make things patterned after something that already exists. The commandment forbids making things with the intent to use them to divert, dilute or otherwise pervert worship and obedience that rightfully belongs to God. It does not forbid making flags that symbolize nations, territories, etc.
The governments of men
The Bible teaches that we should voluntarily pledge to obey the laws of men and even render honor to those who are in positions of authority.
1. Let everyone be subject (submit themselves) to the higher authorities because there is no authority except from God . . . 5. Consequently, it is necessary to be subject to authority . . . (Romans 13:1, 5)
Read carefully, the Pledge of Allegiance encourages those who say it to respect and uphold what America stands for - but it places such loyalty to "one nation" not above, but rather subservient to (through the phrase "under God"), the Eternal's authority.
There is nothing wrong with expressing loyalty toward and obedience to a country or cause so long as what is required does not conflict with fully worshipping God and obeying his law and their intent. Christians are not duty bound to obey any command or edict from any governmental, religious or other authority that conflicts with God's will. For example, the apostles were brought before the Sanhedrin (the highest Jewish religious authority) and verbally condemned for preaching in Jesus' name. Their answer was (and ours should be similar circumstances) rather simple.
29. But Peter and the apostles answered and said, "We are obligated to obey God rather than men . . ." (Acts 5:29)
In spite of its many flaws and missteps, the United States is the leading champion of freedom around the world and is unequaled in its charitable giving to help not only its own citizens but also those around the world.
U.S.-based non-governmental entities (foundations, corporations, individuals, etc.) willing gave more than 300 BILLION dollars in 2009 alone for a whole host of domestic and foreign charitable causes. How incredibly GENEROUS is this amount? It is larger than the GDP (yearly value of all goods and services produced), in 2015, of more than 160 countries! In addition, the U.S. gave more than $31 billion in foreign non-military aid in 2015, the most of any single country.
Pledging to be loyal to the country's founding philosophies of liberty, justice and cooperation among many diverse individuals, yet maintaining one's ultimate allegiance to God, is the right thing to do.