i just put this in another thread, i'll put it here too.
here is why it makes sense. kamui id the ability to travel through dimensions. usually it's just between the kamui dimension and the real world. but we have seen obito use it to move through other dimensions as well. he used his kamui to look for sasuke in kaguya's dimensions. now, obito has died and his soul/chakra exist in the pure world. the pure worl, as explained through edo tensie, is where you go when you die basically. the pure world, for all intent and purpose, is another dimension, but for souls. when obito leaves the pure world, he specifically uses kamui. so now he is traveling from the pure world, to the impure world; kinda like how edo tensie does it, but in this case he brings himself back. but since obito doesn't have a body, he comes back as pure chakra. his chakra/soul than goes into kakashi, similar to how an edo tensie is made excep kakshi doesn't turn into obito. but like edo tensie, kakashi is able to use obito's abilities, in this case his 2 MS. when you look at it this way, it makes perfect sense how it was done.