It is due to the fact that, in the back end, you don't upgrade the weapon, you delete the weapon and then put a new item in the player's inventory, this is also why materia is not preserved. If you had the weapon equipped, there would be a point where you character has nothing equipped to the main hand slot, something that is not normally possible at all. As for why they cannot just replace the weapon in the same slot, I suspect it has to do with new items not being able to be directly equipped to the player and it has to go into the inventory.