I say first, re-watch TOS "A private little War," (and it's quasi sequel TNG's "Too short season," if you imagine Jameson is actually Kirk

), TNGs " The Vengeance Factor," "Attatched," Enterprise's episode "Shadows of P'jem," and 'Detained." These episodes have elements similar to what you are writing about.
The species where warp-capable but the war has destroyed all of that technology a very long time ago.
This sentence, all by itself, basically throws the Prime Directive out the nearest window...
...Also, this star fairing species (one faction) has taken a Starfleet captain prisoner, maybe even hostage, after shooting down a federation shuttlecraft. That's an openly hostile act against the united federation of planets. Possibly even an act of war...
...The Commander is now on much firmer legal grounds for her actions.
I concur. Given the Federation's nature, there'd probably be some sort of investigation. After all, a foreign leader was killed. Perhaps even an official Board of Inquiry. But the Commander's actions certainly would appear to be justified in these circumstances.
The follow up questions I have are:
1. Exactly how advanced are the aliens? Warp capable? Subwarp capable? 20-21 century space travel equivalent? Obviously they are not pre-20th century equivalent, otherwise they couldn't shoot down a shuttle. If they are aware of extra terrestrial life, and even had FC with the federation and other races, space faring, and just aren't as technologically advanced as the Federation, the Prime Directive is not so hard and fast, IMHO.
2. Was the leader that was killed the leader of those holding the Captain hostage? If so, like someone else said, that could be an act of war against the Federation, and they could be justified in taking proactive action.
3. Which side in this war on this world is the villain? The hostage takers or are both sides equally villainous because they have been at war so long? If so, then it seems that one side or the other would eventually gain the upper hand, anyway, so it sounds like it doesn't matter which side wins the war. In fact, you could even argue by allowing one side to win, the federation helped their society. If you have 2 tyrannies at war for years, a lot of people die. If you only have one tyranny ruling, less people die. Machiavellian for sure, but sounds like the lesser of 2 evils.
Bottom line is this: Is the concern that there is true hindrance to the development of the society, or is it just a moral dilemma because one side of the two (both sides being equally bad) gained the upper hand, and some Starfleet admiral is wringing their hands because this first officer assisted one side, to gain the freedom of the captain?
If the former, then that is more serious. That really is up to you, as a writer to decide, really. But you have to make clear why and how it affected this society negatively. If it is basically a situation where 2 sides, one just as bad as the other are warring, and the feds get caught in the middle, and the first officer is a sympathetic character, you are going to really have to make a case why she needs to lose her commission and do jail time, otherwise your readers will be angry with the result. Unless that is your intent to begin with, then that is different.
If it is the latter, I would say the first officer actually had a no win scenario, did the right thing, and shouldn't be kicked out of starfleet. Reprimanded for sure, for breaking protocol, possibly even demoted, maybe even 30 days in the ships brig a la Tom Paris, but no dishonorable discharge and\or jail time on a penal colony. But if the Captain actually punishes the first officer for saving his\her life, then the captain is going to be seen as an a-hole by the reader.