Remember Worf killed Duras under Klingon law and received no punishment for the deed.
But only because he did it on a klingon ship and the klingons were fine with it, had he killed Duras on the Enterprise it would have been murder, klingon laws wouldn't have applied.
I'm pretty sure Picard rips Worf to shreds at the end of the episode and tells him "a reprimand will appear on [Worf's] permanent record."
Granted, it's not a prison sentence or anything, but to say Worf received "no punishment" is inaccurate.
As for Lore, this was an android who, every time Data encountered him, had proven he was not interested in peaceful co-existence. Lore tried to feed the Enterprise to the Crystalline Entity, he later murdered Dr. Nonnian Soong, and then as others mentioned, led a revolt with the Borg, arguably Starfleet's greatest threat. Putting morality aside for the moment, if you have the option to turn off a crazy-ass killing machine, you take it. Then
you talk about what to do about him.