Because of how the specific spell works and the laws of magic as they operate in your 'world'.
You start by assuming spells were tried which physically erased the memories and/or personalities of subjects but there were inevitably severe side affects i.e. the brains of the victims were traumatized. This was because the effect of the spell was physical ie it directly effected the biochemical processes involved in forming and retaining memories. Since these are innate to the nerve cells and networks involved in memory & personality the effect was like concussing all the nerve cells in the relevant parts of the brain at once. The result, if not death was a coma like state and permanent brain damage.
So instead after some research magicians decided try using magic to induce a 'Geas' on the target instead. The Geas involves a couple of spells working together on a permanent basis. In part the spells impose a command 'do not remember X'. The next step is 'You must remember Y' With 'Y' being whatever false memories the caster or their commanders wishes the person to believe are true. Perhaps another spell then effects personality traits the same way.
This approach works because your not physically destroying any memories just compelling the victim not to remember/change etc. But there's a cost.
And that's where the laws of magic come in. The first (unsuccessful) spell was more or less a one shot physical attack, or at least several of them in a row i.e. the spell is cast and a permanent effect is caused, job done. Everyone walk's away happy - except of course the victim.
However the second type of spell is an induced effect or set of 'instuctions' that needs to operate continually in order to be effective. Its a permanent magical 'construct' not fire and forget. This means the spell has to be maintained/checked at intervals and worse that another magic user can remove it if they wish. Not only is the spell more time consuming and arduous to maintain, its also reversible.
So the death penalty stays in place, especially for any rogue mages who decide strike down another practitioners memory spells without authority.