It’s really racism. But if you want the legalistic explanation, here it is…
The United States started out with 13 states that were all ex-British territories on the Eastern seaboard of North America. There are now 50 states. Every state after the first 13 got its statehood by first being a territory, adopting a state Constitution at a constitutional convention, and then getting that Constitution approved by US Congress, and so being “admitted to the Union.”
Under the Constitution, only states (and Washington DC) participate in the electoral college. The concept of non-state “territory” did not necessarily exist when that part was written, because there were only the original 13, and the Louisiana purchase wasn’t done until later.
[Washington DC is a very special “district” that is not a state and not a territory.]
Puerto Rico has stayed at the territory stage since it was acquired in the Spanish-American war (started 1898). Why? Well, mostly racism. There have also been some popular votes in Puerto Rico, with very mixed results. In the currently evenly split political climate, getting any new state admitted is probably impossible (as it was before the civil war).
There’s also some undercurrent that maybe the US is kinda uncomfortable holding on to these overseas islands (which are mostly connected to the same Spanish-American war). Philippines became an independent country. On the other hand, Hawaii got statehood in 1959 (but there was a whole racist history there of white colonization).
Like any other convention, it’s not really a big deal either way. Fortran gets along just fine with 1-indexing.