Look at the Wifi Cloning Glitch, it's the by-product of a precaution to avoid the players losing pokemon in the result of console/connection failure. If they had instead removed this precaution, then it would be worse in the long run. Imagine the complaints they would cop if players were losing their pokemon...
This is the truth of the matter.
In Gens I and II, cloning could be the result of a well-timed system shut-off during a box deposit. In these games, there wasn't enough storage to afford a backup save file, so the one you had was it. It would have been extremely easy for them to put a check (either a checksum or a "write in process" flag) to detect a partial game save, but their only option in this case is to delete the savefile entirely. Instead, they were thoughtful, and let the player recover a corrupt savefile in this case. Cloning was one of the possible results.
In GenIII and on, the savefile is backed up, and attempting this causes the old savefile to be restored.
All the various trading cloning "glitches" (not true glitches for the following reason) are completely unavoidable for one very basic reason:
It's impossible to perfectly synchronize two machines. One is always going to perform a particular key save operation just a little bit before the other, and if the other is shut off during this window of opportunity, one game gets saved but the other does not. Cloning is the result. Again, for the GTS, they could've made it that YOUR game saves before the remote server does, which would've resulted in possible deletion of your Pokémon, but, instead, they opted for the cloning possibility because they deemed it preferable.
Emerald cloning is weird and probably could've been prevented.