It had been over a century. I think it's safe to say that the Federation just in general adopted a more lenient judicial system in the meantime. Certainly the horror with which the Federates in VOY's "Repentance" consider capital punishment would suggest an evolution in Federation legal practices since TOS's "The Menagerie" established a death sentence for people who contact Talos IV.
First off, that was a Starfleet death penalty, not a part of Federation civil law. It would only have applied to Starfleet personnel. And second, it was the only death penalty on the books, an extraordinary exception to the norm. So I think you're off-base if you're implying that the 23rd-century Federation was okay with capital punishment.
EDIT: Well, at least the core worlds. Ardana was a Federation world and had the death penalty, but it also had institutionalized discrimination, so I wonder if maybe the Federation signed them up too hastily, or if some politician looked the other way to get the mining rights there. We know Deneb V had plenty of death penalties ("I, Mudd"), but it probably wasn't in the UFP, at the time, because in "The Pirates of Orion," the Enterprise
was sent to represent the Federation at the dedication of Deneb V's new Academy of Science, something that I doubt would be necessary if the planet were in the Federation.