T'Pau pulled Spock's ass out of the fire at the end of "Amok Time", but at the end of "The Menagerie", too?
Perhaps the Talosians requested leniency and Starfleet was inclined to grant it since you don't want a race of people who can project illusions pissed off at you?
Thinking about it, the Talos IV death penalty is a bit stupid anyway. It's like putting a big flag on this out of the way planet shouting "Something Important Here."
You could imagine a conversation aboard a Klingon ship.
Klingon 1: Did you know the soft Earthers don't even have a death penalty?
Klingon 2: You're wrong, again. They do. For visiting Talos IV.
Klingon 1: Wonder why? Must be something important. Maybe even some awesome alien technology we could weaponise?
Klingon 2: Oh, interesting. But we can't go there, or the Earthers will execute us!
Klingon 1: Setting course now. Engaging cloak.