QFT. Those episodes you mention really made me angry.The Prime Directive is one of the most problematic aspects of Trek. It also doesn't help that TNG-era Trek onwards mutated the PD into something unrecognizable and monstrous.(See TNG's "Homeward," "Pen Pals," and ENT's "Dear Doctor," for example.) I think it was a product of 1960s Vietnam War-era liberalism on the dangers of cultural imperialism. But TOS was never as rigid about the non-interference aspect, especially if from a utilitarian perspective, they could accomplish more good than harm through interference.
I've never understood "non-interference" as a moral principle in itself. The PD should have been abolished long ago, and the issue of whether intervention is warranted should be on a pragmatic case by case basis.

The Prime Directive is tricky: it can be used to prevent the Starfleet from becoming the Universe Policeman... but it can also be, as in the cases mentioned above, used as an excuse to do stand by and do nothing, or even refuse help ("Dear Doctor" being the most blatant example). It turns into a nice way of saying "since you are a different and less advanced civilization, we will leave you to your own devices, since we don't really give a fuck about you and whether you all die or not, you stupid savages". How is that any better than imperialism and its White Man's Burden? Two sides of the same coin. It also begs the question, what is Federation Starfleet and its exploration really for, except for Federation's own gain? The Federation gets to find out about different planets and civilizations, and this benefits the Federation, but what do these worlds get out of it? Unless they are already warp capable and advanced enough to be of any use to the Federation. If Federation Starfleet is supposed to have humanitarian and noble goals, then such a ridiculous and strict interpretation of the PD renders it completely useless.
IMO, the PD should be only a guideline that has to be interpreted on a case to case basis.