Of course the opposite could also true, and the Earth still has sovereign states/countries in the 24th century and beyond.
They literally refer to last of the "the old nation-states" as joining the "world government" in 2150 in TNG "Attachment," so I have no idea how you could have a government that isn't sovereign and or the idea that nation-states are still sovereign with the idea that nation-states are referred to as a thing of the past.
I've never felt that the federation was some kind of interstellar state,
A stance which defies canonical evidence. Sovereign states are generally defined by possessing a distinct territory over which they exercise sovereignty, often possessing a constitution and statutory law that is binding upon all people within that territory; they possess a government capable of making law and which holds the legal monopoly on the use of force, and the government commands a military force and often an internal security force. The government usually possesses an extensive bureaucracy. A sovereign state conducts relations with foreign powers. A sovereign state possesses a system of courts that enforce law within their territory, and often the head of state possesses the power to pardon convicted criminals. A sovereign state has people who hold citizenship with it, and citizens who betray the sovereign state of which they are a citizen are usually considered to be guilty of a specific crime called treason. Sovereign states have the legal capacity to suspend some civil rights and liberties in times of crisis.
The Federation meets all the criteria for a sovereign state. The Federation possesses distinct territory (TNG "The Best of Both Worlds, Part I") over which it is sovereign and in which the Federation Constitution applies to all persons (TNG "The Perfect Mate"). The Federation Constitution enumerates certain civil rights and liberties that are guaranteed to all persons within Federation territory and aboard Federation starships (TNG "The Perfect Mate").
The Federation possesses its own military in the form of Starfleet (TOS "Court-Martial," TOS "Errand of Mercy"), and Starfleet's full formal name is indeed the Federation Starfleet (DS9 "Tribunal"). There is an internal police force called Federation Security with legal authority to place people under arrest (TSFS).
Members of the Federation's population are citizens of the Federation (DS9 "Tribunal," DS9 "A Call to Arms," DS9 "Inquisition," DS9 "Heart of Stone"). Citizens of the Federation who betray it by attempting to launch coups d'etat or by giving classified military deployment information to a hostile foreign state are considered to have committed treason (DS9 "Paradise Lost," DS9 "Statistical Probabilities").
There is a Federation government capable of passing statutes that are legally binding upon all persons within Federation territory (TNG "Force of Nature"). The Federation has a system of courts that enforce Federation law, including Federation grand juries ("The Ascent") and a Federation Supreme Court with the power of judicial review over statutory laws (DS9 "Dr. Bashir, I Presume?"). The Federation President possesses the legal authority to grant a pardon to convicted criminals (DIS "Will You Take My Hand?") and the legal authority to declare a state of emergency within Federation territory that suspends certain civil rights and liberties (DS9 "Homefront").
The Federation government conducts relations with foreign states directly, without consultation from member governments (TUC) and has the legal authority to declare war upon foreign states (TOS "Errand of Mercy," DS9 Dominion War arc et al).
The Federation government also possesses an extensive bureaucracy (every episode with a Federation Department of miscellaneous bullshit). It also possesses specialized security agencies that investigate allegations of specific types of criminal offenses (DS9 "Trials and Tribble-ations") and its own intelligence agency in Starfleet Intelligence (TNG "Chain of Command," et al).
The United Federation of Planets, simply put, possesses
all of the traits of a sovereign state. And it is important to note that it is not any one or two of these traits, but all of them together as a whole, that define it as such.
He also stood when an American flag was brought into the room, most people wouldn't do the same if it was just their local state flag being walked in.
Kirk was explicitly established throughout TOS as being a history buff, though. There's no indication that most people in the Federation as nearly so attached to the identities associated with "the old nation-states" (as Crusher calls them in "Attached).
Would the average person from Earth stand if the federation flag (if there is one) were brought in?
In DS9 "Take Me Out to the Holosuite," all of the characters stand at attention and place their hands over their hearts while facing the Flag of the United Federation of Planets as the Federation Anthem plays.
Weirdly, Lower Decks is canonizing a crap ton of Star Trek: Expanded Universe stuff left and right.
Andorians, Vulcans, and Tellarites are now the founders of the Federation. Training also takes place for humans on Vulcan.
And so on and so on.
Nope, it ended before they could make the Federation.
Yes, and secondary material has said they helped found the Federation for decades but it was only confirmed in the animated show.
To be clear, it was Daniels's dialgoue in ENT "Zero Hour" that first established that Humans, Vulcans, Andorians, and Tellarites founded the Federation, not an episode of LD.
In the novels and other non-canonical tie-in works, the formal states are listed as United Earth, the Confederacy of Vulcan, the Andorian Empire, and the United Planets of Tellar. They often incorporate a fifth founding member, Alpha Centauri (the Alpha Centauri Concordium as its formal name); Alpha Centauri is usually depicted as a former Earth colony that had gained its independence prior to the UFP being founded, thus lumping them in with Humans in the list of founding canonical species. This is consistent with the canon as of, well, yesterday, but I haven't seen the most recent episode of LD yet so something in it might have contradicted this.
This feels far too hair-splitting-y to me.
Like acting like the states who signed off on the Declaration of Independence couldn't be viewed as founding states of the USA until you've also seen the signing of the US Constitution, despite the fact that all of it is in the past and you know for a fact that none of those states backed out of being part of the US (at least not successfully).
I think drawing that distinction with regards to the U.S. is actually perfectly reasonable. If you look at the text of the Declaration of Independence, it specifically says that the Thirteen Colonies are all separate independent states -- in other words, they're not
one sovereign state called the United States of America, they're
thirteen separate sovereign states called New York, Pennsylvania, Virginia, etc. Those thirteen separate sovereign states then formed an alliance under the Articles of Confederation, but that alliance did not possess sovereignty; it was more akin to the European Union today, insofar as its powers were delegated to it by the states, it had no power of taxation, and real sovereignty lay with its member states. Only with the passage of the United States Constitution did those polities unite to create a sovereign state called "the United States of America."