Using the definite article before a country/state name
There are certain countries and regions which are traditionally referred to with the definite article: anywhere where the proper name is a description (The United States, The Gold Coast, The Windward Isles), but also certain names which are not (The Ukraine, The Punjab, The Gambia, The Argentine).
Some which were traditionally used this way are no longer: "The Argentine" is now usually replaced by "Argentina"; I believe that the government of Ukraine have specifically requested that their country not be referred to in English as "The Ukraine".
Descriptive names where the description is merely identifying one part of a whole do not usually take "the": North Korea, British Honduras, Inner Mongolia.
Many countries with simple names have a formal name which is a description, and these of course take "the": The Republic of China, The Dominion of Canada.
The use of "the" with a country or region name is rarely optional: in nearly all cases it is fixed, depending on the country or region.
Phrases like "The Spain of General Franco" are entirely different: they are a construction which can be used with proper nouns in general: "The John I used to know", "The Liverpool he returned to".
Along with the answers already here, it may be helpful to know that the Punjab is a geographical region, some of which is in India and some in Pakistan. When we speak of the region, we call it the Punjab, and when we speak of the official state, it's usually just Punjab (without the article). In historical writing as well, the region is referred to as the Punjab.
IMO, it's all about plural and singular.
You could even argue that loosing the definite article is actually the last state of a normal process in the evolution of a country's name as it progresses towards unity.
For instance, in this thread Spain is often cited as a reference of not having an associated definite article. That's certainly true today but that was not always the case.
Back in the Roman era what we now call the Iberian Peninsula was called Hispania. There were at various times more than one Roman province therein (Hispania Citerior and Hispania Ulterior; later Hispania Tarraconensis, Hispania Baetica, and Lusitania; and in the Verona List a total of six "Hispaniae", including part of North Africa) [Thanks to Peter Taylor for this Precision].
Then, in the XVth century Fernando de Aragon and Isabel de Castilla were referred to as "Reyes de las Españas".
Nowadays, that it is a single entity again nobody in Spain would use "Las Españas" or "En la España" but instead "En España".
Punjab, as everybody knows, being the land of 5 rivers, still conveys a sense of plural, which could justify an article.
Evolution Path
As a rule of thumb, you could theorise that when several entities are grouped together, an implicit plural is present in the place name and that this implies an article.
After a while, though, if there is no ambiguity (if the proper name has no other meaning), then the group type ("islands", "lands", "united") is dropped but the article remains (at least for a while) and that is the root cause of the confusion.
Dropped "islands" - still with article:
The Azores, the Canaries, the Falklands, the Galapagos. However nobody dares to shorten "the Virgin Islands" to the "Virgins" because that could generate some misunderstanding ;-).Lands: The Netherlands (plural because these are the lands at or below sea level): in most languages, with plural article. But nobody says "The England", "The Scotland" because Angles and Scots have only one land.
One special case is Flanders (no article in English, Dutch, Spanish and German but an article in French (plural), Italian (plural) and Portuguese (singular!).United something:
The United States, The United Emirates.
In these case, the implicit plural demands an article. However it is commonplace to hear "In the States" or "In the Emirates", the entity type is dropped but the article remains.