I am inclined to think that nature implemented/adopted a system to “recycle” our life energy a.k.a. soul, hence reincarnation.
Not too sure about retaining previous memory though but if reincarnation is true, then it might not be intended so because it will complicates matter.
Take for example, suppose you are reincarnated as the child of your nemesis or someone who has done grevious harm to you in the previous life… What are you going to do? Kill you parent? Forgive the person? Then how about the spouses that you left behind in your previous life?