Rabbi Moshe Chaim Luzzatto (the RAMCHAL) makes an interesting statement in his famous book “The Way of G-d – Derech Hashem”, 1:3.
“Man must die so that everything corrupted perishes. The soul cannot purify the body until the body dies and deteriorates and a new structure is composed, that the soul can enter and purify.”
This is why we have the concept of TECHIAT Ha’METIM (the Resurrection of the Dead). The true time and place of reward will be after the resurrection in a renewed world.
And because there is DEATH, body and soul must be kept separately. The body decomposes, is losing it’s form and returning to dust. The soul, on the other hand, enters the World of Souls after a person dies. There, the soul waits for the renewal of the body.
Why doesn’t the soul purify the body while a person is still alive? As a matter of fact, the soul would have the power to do so and could thus perfect itself through this act. However, the soul does what G-d orders it to do. It is only G-d who does good and bestows perfection.
The soul must remain restricted in order that G-d’s plan for this world is going to work out.
I find this makes a lot of sense. We are constantly asking “why we have to die” and “what is the purpose of all this”. Here, the Ramchal is providing an explanation. Of course we cannot be sure that it is the right answer but be honest: We will never know.