The PD was meant as a "We won't mess with societies that have no clue other intelligent life exists or that interstellar space travel is possible..."; BUT, once they were spacefaring, PD no longer applies (TOS).Prime directive was meant as principle of non interference in internal politics, as critique of the Cold War era proxy wars. It was never meant the way it is used in Pen Pals and Homeward.
The TNG version of: "If they ain't already UFP members...hands off..." <--- It got ridiculous.