...By a country that largely claims to follow a belief system wherein it is explicitly and plainly laid out:
"Don't swear oaths (Matthew 5:34). Don't make idols / worship images or objects." (The second commandment)
Not just an inanimate object - an idea that that object is meant to represent! We're about one level of abstraction away from the pledge of allegiance becoming a meaningless mantra of words with no meaning or relation to one another strung together to make a pretty song that is always sung off-key by grade school children.
I mean bag on the pledge of allegiance all you like, but using the flag as a synecdoche of the nation as a whole doesn't seem like it is as great a leap of logic as you are making it out to be.