And, my reading of some historical accounts is that Robert E. Lee initially refused to become commander of the Union army in the spring of 1861 because his first loyalty was to defend his state of Virginia, which was about to secede from the Union.
The name of the country was a plural prior to the Civil War: "The United States are entering into a treaty."
After the war, it shifted to a single entity: "The United States is entering into a treaty."
The difference was that most people identified with their state first, then the United States second. The current understanding for most people is to identify as an American first and their state of birth or state of residency second (if at all). So given the choice, it's not altogether unreasonable that Lee chose his native Virginia.
When my kids were in school and the state made a fuss about reciting the pledge to the Texas flag, I told them they didn't have to say it if they didn't want to, and I would back them up. My reasoning is that we are citizens of the United States, but only residents of Texas.