Question: "Does Christ's prohibition against oaths in Matthew 5:33-37 mean that we should not pledge allegiance to the flag?"
While Christ certainly forbade the making of foolish and idle oaths, he did not forbid the making of solemn promises. One thing that you find through Scripture is the concept of covenant, and a covenant is a binding and solemn promise.
Take marriage for example, which is one of the most common forms of a covenant that we still enter into today, In marriage we make a covenant with our spouse, with God as a witness, that we will remain faithful to them as long we both shall live.
The Prophet Malachi called the Israelites to task for failing to fulfill this covenant:
"And this is the second thing you do: you cover the altar of the Lord with tears, with weeping and crying; so He does not regard the offering anymore, nor receive it with goodwill from your hands. Yet you say, “For what reason?” Because the Lord has been witness between you and the wife of your youth, With whom you have dealt treacherously; yet she is your companion and your wife by covenant. But did He not make them one, having a remnant of the Spirit? And why one? He seeks godly offspring. Therefore take heed to your spirit, and let none deal treacherously with the wife of his youth. “For the Lord God of Israel says that He hates divorce, for it covers one’s garment with violence,” says the Lord of hosts. “Therefore take heed to your spirit, that you do not deal treacherously” (Malachi 2:13-16).It is clear from these verses that we can and do enter into binding covenants, that God is a witness, and that to fail to live up to those covenants is therefore treachery against both the person the covenant is made with (in this case, one's spouse), and treachery against God himself.
Furthermore, the Church does not teach that Christ taught against all oaths. The Catechism of the Russian Orthodox Church, composed by St. Philaret of Moscow has the following comments with regard to the third commandment:
"532. When is God's name taken in vain?
It is taken or uttered in vain when it is uttered in vain and unprofitable talk, and still more so when it is uttered lyingly or irreverently.
533. What sins are forbidden by the third commandment?
1. Blasphemy, or daring words against God.
2. Murmuring, or complaining against God's providence.
3. Profaneness; when holy things are jested on, or insulted.
4. Inattention in prayer.
5. Perjury; when men affirm with an oath what is false.
6. Oath-breaking; when men keep not just and lawful oaths.
7. Breach of vows made to God.
8. Common swearing, or thoughtless oaths in common talk.
534. Are not such oaths specially forbidden in holy Scripture?
The Saviour says: I say unto you, Swear not at all, but let your communication be, Yea, yea; Nay, nay: for whatsoever is more than these cometh of evil. Matt. v. 34, 37.
535. Does not this go to forbid all oaths in civil matters?
The Apostle Paul says: Men swear by the greater; and an oath for confirmation is to them an end of all strife. Wherein God, willing more abundantly to show unto the heirs of promise the immutability of his counsel, confirmed it by an oath. Heb. vi. 16, 17. Hence we must conclude, that if God himself for an immutable assurance used an oath, much more may we on grave and necessary occasions, when required by lawful authority, take an oath or vow religiously, with the firm intention of not breaking it."It should also be noted that St. Paul often called on God as a witness to what he said, which is what we do when we give an oath in court or when taking an oath of office:
"For God is my witness, whom I serve with my spirit in the gospel of his Son, that without ceasing I make mention of you always in my prayers" (Romans 1:9).
"I say the truth in Christ, I lie not, my conscience also bearing me witness in the Holy Spirit (Romans 9:1).
"Now the things which I write unto you, behold, before God, I lie not" (Galatians 1:20).So no, there is nothing in Christ's commandments nor in Church tradition that would prevent us from saying the pledge of allegiance.