Alright, serious response time.
Your officer messing with a war by giving one side absolute power is the most severe violation of the Federation's laws and principles. Yes, the Prime Directive can be violated at times based on extenuating circumstances, but your scenario is very black and white. I can't imagine a worse crime that could be committed by a StarFleet officer outside of treason. I would expect being kicked out of StarFleet at the very minimum and life in prison as the most likely outcome.
I'm not so sure. If you evaluate the tactical and supply situation, you could make the case that the fall of the leader (if he was in a poor position) was pretty much a forgone conclusion. Did the actions actually shift the balance of power on a planetary scale? Or is the action likely to be no more than a blip in the grand scheme of things?
Then you have the "what's worse?" scenario. You have a group of Starfleet officers being held that have not only high-tech trinkets with them but also the "know how" to basically shift the balance of power if conditions become dire enough. Or you help someone else, creating a possible shift in power, but leaving the technological status quo in place.
They try to show the Prime Directive as a clear-cut law when in fact it is very murky based on the evidence we've seen across the various shows.