In my not so humble opinion, the PoA is (was*) a pledge of allegiance to a set of ideals that is grander and more noble than just one's self. It certainly is not a pledge to a government.
Respectfully, I consider you mistaken on this. The pledge is most certainly an allegiance to a nation, or to the government if you wish to phrase it that way.
I base my opinion partly on how it evolved over time. Originally:
I pledge allegiance to my Flag and the Republic for which it stands, one nation indivisible, with liberty and justice for all.
It then became:
I pledge allegiance to the flag of the United States of America, and to the republic for which it stands, one nation indivisible, with liberty and justice for all.
The final change was the addition of "under God" -- and I won't get into that aspect. I will say I consider it entirely unimportant and that's about it.
From what I gather the change from "the Republic" to "the United states of America, and to the republic" was made to ensure immigrants knew darned tooting well who they were pledging allegiance to. If it were about our ideals we'd have seen that expanded, or the pledge left alone, but that's not what happened.
Beyond that, and this is perhaps more important, is what you'll see in comments whenever somebody objects to the PoA. We're a lot more civil here than the rest of the web but even here I've seen questions of loyalty and whether or not the other person believes the US is the greatest nation ever. That's exactly the type of response you'd expect when somebody questions a loyalty oath that's done a good job of indoctrinating people.
You don't get questions about "liberty" and "justice" -- you get questioned about how much you love America. Nobody asks you if you hate the BoR, the DoI, or the constitution, it's all about wars, sacrifice, loyalty. patriotism and such.
But that's what's to expected from an 18 second "jingle" for your country. We repeat it over and over again until the concepts aren't distinguishable from the article in question.
Here's a thought experiment for you. Let's flip some new words into the PoA and you tell me what the take-home message is:
"I pledge allegiance to Tide the detergent, and the stain fighting powers for which is stands. One detergent, unmatched, with clean clothes and comfort for all."
You get a kid to repeat that every day and guess what happens? They buy the Tide brand. They don't go on to promote clean clothes and comfort -- they just suck up "their" brand of detergent.
I feel like it'd be fun to keep playing with this, so let's flip it around a bit and pretend we're making a pledge for Tide employees to motivate them. Try this:
"I pledge allegiance to fighting stains, keeping clothes clean, and comfortable. I will do everything in my power to ensure that Tide always rises to these standards."
Totally different message. You put the goal in front of the "brand" on this one. The same could be done with the PoA:
"I pledge allegiance to liberty and justice for all. I will do everything in my power to ensure that the United States always rises to these standards."
Same ideals, same country, but we don't say it that way, and for good reason. It doesn't evoke unquestioned brand loyalty.