Actually the Prime Directive is very clever and not totally out-of-this-world, because it reflects core values represented by Philosophists like Sokrates or Kant, on which many institutions of the modern western civilized world are based on (Democracy, State of Law, Freedom of Speech, Declaration of Human Rights).
The prohibition of torture for example shares the same core value with the Prime Directive.
The Primary Directive acknowledges, that if the Federation would be allowed to save civilizations at will, they would do so according to their interests and their current state of knowledge at that time.
Example: Three planets of a solar systems are in peril. On one planet, a technically advanced society with a democratic, freedom based system lives. On the other one a civilization living in caves without much knowledge. On the third one a totalitarian system like the northkorean Dictatorship or the National Socialists. The Federation can only save one planet.
Without Prime Directive, it would just chose the one, that goes along with the Federation culture and the Federation values, which shares the interests of the Federation: The first planet. And it would let the others die. Why? Because they have no value to the Federation or even are considered of a lower moral quality. Because the Federation has no interests in these planets and societies or even has a strong interest in killing those people - but instead of doing it themselves, they let nature do the dirty work for them.
With the Prime Directive, the Federation and the people representing them, are always reminded: If you make such a choice, you do it according to your personal interests, who you share your culture with, whom you are more comfortable with living. Because of the Prime Directive you just cannot do that. You always have to stop and reflect.
Its like with the prohibition of torture: Even if you think, it is in your interest to torture someone, because it helps your interest, maybe saves someone elses life that you have an interest in, you are not allowed to. Because you might not torture someone, because it is right and it actually is for something good, you might only torture someone, because in that moment it is in your personal interest to do so and because the knowledge of that moment, which may be wrong or colored by your personal interests, gives you the illusion, you do it for the right cause.
And in the end, this cause for torture was wrong, and while you only needed to change your mind, the damage done by torture to the other person is permanent and not reversible.
Like it is not reversible, if you just saved a society because of wrong knowledge, colored knowledge by your interest, or just because you thought, you like someone better than the other one.
And of course it has a direct connection to the politics of the US, where Star Trek was developed. The US always had the policy, that it is allowed to interfere in other societies at their will - if it is in the interests of the US at that moment. One year, it gives weapons and money to a group, and saves them by doing so, that ten years later slaughters helpless people in their own country with these weapons or use the money to attack the US itself. The Prime Directive is pretty much the alternative policy to how the US is doing their foreign policy.