I don't remember, is death penalty mentioned in some episodes?
In the episode The Conscience Of The King, the governor of a colony world imposed the death penalty on half the population. It sounds on the surface like it was a Earth colony.
The Wormhole wrote:
In the 23rd century, violating General Order 7 is the only crime punishable by death in the Federation. Stated so in The Menagerie.
MENDEZ: And to do so is the only death penalty left on our books
. Only Fleet Command knows why.
That to me sound like it's the only death penalty on Starfleet book's
from the way Mendez says it. The Federation might have no civilian death penalty, or that could be the penalty for a number of civilian crimes. Also the various Federation Members could have the death penalty within their own legal codes.
We have the death penalty here in Washington State, but we only use it about once a decade.