How did Starfleet create an entire starship?
We have sent men to the moon, and robot craft have landed on Mars, but we haven't created a human clone yet. And, even if we did that, it wouldn't have the memories of the original.
Building a starship seems easy in comparison.
But did they explain WHY the demon planet created this duplicate? Given that the ship and crew disintegrated, maybe it doesn't matter what the reason is -- except, if there was no reason, the whole plot seems to fall apart.