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!
I took it to prevent people from going to Talos and learning their vast powers. Not to prevent the Talosians from doing anything.
"KEEPER: Your race would learn our power of illusion and destroy itself, too."
Which, if a simple thing, is exactly what would happen. And if it is a simple thing, then I think the death penalty is very warranted. But as someone else noted....the sheer curiosity this would create...how will you keep it a secret? Hell, the Klingons were all over Genesis before Kirk even got back to Earth.