But that's not the penalty that the Edo specified for the crime Wesley committed. When Starfleet sets foot on an alien planet they should be under the laws of that planet. It's not like they were even invited. They simply showed up, beamed down and assumed that things worked the same there as they did in the Federation.
Tough luck. Regardless of whatever local laws are in place a Starfleet captain sitting in the command chair of an orbiting battleship wouldn't, for example let a ten-man away team be executed because they're wearing black in summer should that be deemed necessary by that planet's laws.
There are some universal constants, and crushing (pardon the pun) some flowers doesn't deserve death on whatever world you happen to be visiting.
As much of a prat as Wesley is...