Was it ever explained why and how was the planet from Star Trek TOS episode, "Miri", was an exact duplicate of Earth?
In my opinion this was the most interesting question in the episode and it was left unanswered.
Memory Alpha gives this explanation: Hodgkin's Law of Parallel Planetary Development
The theory was that similar planets with similar environments and similar populations tended to gravitate toward similar biological developments over time. Although initially applicable only to biology it was later expanded to include a tendency to move toward similar sociological developments as well with sentient beings.
I don't recall this being answered in the episode but there is a Star Trek reference book called The Worlds of the Federation, which indicates that not only the planet, but the entire solar system was an exact duplicate of the Sol system and was created by the Sol system passing through a temporal or spatial rift of some sort and being duplicated.
Another Star Trek reference book, Star Trek: Star Charts, indicates rather that the planet was a terraformed recreation produced by the Preservers and populated by other groups of people taken from Earth in the past as they did with the Native Americans in another episode of TOS. Both works indicate the natives called the planet Earth and the Star Charts book indicates the capital city before the plague was called New York.
In the DTI novel: Forgotten History by Christopher L. Bennett,, Miri's Earth was actually Earth itself, of an alternate timeline. Miri's Earth had briefly drifted into the main universe due to instability in the local sector of space. It later returned to its original timeline.
In the Preserver novel series by William Shatner, the planet was revealed to have been duplicated from Earth on a subatomic level by the Preservers.
Also in this novel series, there was a reference to duplicates of several other planets, "Starfleet managed to uncover at least three duplicate Earths, four duplicate Qo'noSs, two of Vulcan and one duplicate Andor. These worlds were kept highly classified by Starfleet for fear of the panic it would create to members of the United Federation of Planets. "
But as far as I know there has never been a in-episode expaination as to the how-&-why.