I am attempting to develop a coherent argument for a "prime directive," or law that respects the right to self-determination of less advanced civilizations. In Star Trek the Prime Directive is generally used to justify genocide, which I would attribute to bad writing.
If there wasn't a prime directive, then what would protect less advanced civilizations from being forcibly colonized and sanitized by an more advanced civilization? This has happened many times in human history and the disadvantaged civilizations are still rebuilding centuries later.
Japan rapidly industrialized and became imperialistic conquerors in direct response to the USA's gunboat diplomacy. The government still denies that they committed numerous atrocities that were extensively documented.
China has a cultural imperative to assert their superiority after the self-described "century of humiliation" inflicted on them by the British. The British, in another display of gunboat diplomacy, coerced countless innocent people into addicting themselves to opium.
Vietnam is still suffering the effects of Agent Orange. When they tried to sue the USA for damages their claim was thrown out of court. The descendants of USA veterans suffering those effects did get compensation.
Africa has numerous active war zones. Most of the indigenous civilizations were wiped out by Europeans and they had to rebuild from scratch.
North America used to have numerous ancient ruins, rivaling the pyramids, which were demolished to make parking lots. Like Africa, most of their indigenous civilizations were wiped out.
I cannot imagine any reason not to have a Prime Directive that prevents interference in the affairs of civilizations that cannot adequately defend themselves. (I don't count natural disasters like asteroids. Starfleet has a moral imperative to stop those.)
Imagine how a space faring civilization would go about forcibly uplifting less advanced civilizations ostensibly for their own good. A medieval planet would see the arrival of benevolent invaders who force them to give up their culture because it the invaders find it repugnant. If the aliens refuse, the invaders would have no choice but to enslave and indoctrinate them. Essentially, the Borg.