I think the whole point of the "Prime Directive" was to provide absurd, immoral unintended consequences when it was slavishly followed with religious zeal. High drama then ensued when the Captain then had to choose to break the rules and risk his career to do what was obviously (to the viewer) right. Like a galactic example of zero tolerance rules in an elementary school. Sometimes the aliens chew their toast into the shape of pistols and shout bang, bang.
it's also a good scapegoat to people wondering why they only fight the monster of the week on the many preindustrial planets they meet then adbandonig them to their quotidiane misery afterwards instead of, you know, dropping a basic medicine handbook and a civil engineering primer so they don't all die from infection and water shortages.