Makes good sense. Criminals in TOS aren't punished - they are cured. You can be cured of being a murderous asshole, and punishing you would serve no purpose whatsoever. Well, except satisfy the bloodlust of your victims. But if they have such bloodlust, they are disgusting criminals themselves, and need to be cured.
But going to Talos is not a crime. It's a fatal mistake. You can't be cured of going to Talos, because you are irrevocably corrupted by Talosians; you will help them escape their planet; and then the whole galaxy will fall to their telepathic powers. The only cure to that is death: if you return from Talos, you can't be allowed to live.
That is, until the events of "The Menagerie" prove that the quarantine of Talos is futile from the get-go, as Spock has been corrupted across interstellar distances and a starship has been brought for the Talosians to use. All is lost at this point, and the death penalty makes no sense: either Talosians have proved their goodwill by not taking over the universe and the penalty is not needed for containment, or they have already taken over Starfleet with their illusions and the penalty won't do any good!
Or you could have just confined anyone who you suspect currupted in a penel colony or a Federation loony bin were they are confined and cant hurt anyone?
Why not have capital punishment for crossing the Romulan neutral zone or playing the bongo on a klingons forhead? Both of which would have caused a equal amount of hurt for the federation.