I just wish, even in TOS (where it probably makes as much sense as it ever will), it made a bit more sense.
I assert in the TOS era makes the most sense.
SPOCK: Then the Prime Directive is in full force, Captain?
KIRK: No identification of self or mission. No interference with the social development of said planet.
MCCOY: No references to space, or the fact that there are other worlds, or more advanced civilisations.
That's it. "No interference" was limited to the social development of the planet. Until said planet is capable of understanding and accepting there are countless alien civilizations out there, that information needs to remain hidden from them.
So it was never "no interference in any way, shape, or form." It was "don't interfere with their social growth and development." Let them figure out on their own racism is bad, but don't let them go extinct, either.
So, save Miramanee's planet from the asteroid. Georgiou and Bernham can restore water to the people hibernating in the desert. Scotty can cause a city wide blackout. It's OK to interfere as long as it looks normal, natural, or unexplained.
But, no, it's wrong to turn Ekos into a Nazi theme planet. That is social interference. It's wrong to give the hill people superior weapons to defeat the village people. Overthrowing primitive governments and supplying arms to aboriginese is social interference.
Saving Drema IV? That's acceptable as long as the citizens are unaware of Federation involvement. How the D accomplished this was the right way to do it, but they should have found this solution sooner. The people in Homeward? Well, there was no way out of that one without tipping their hand immediately. It's impossible to move a tribe or village to another planet and remain secret. Not understanding what caused a blackout (Bread and Circuses) is one thing, having a village wake up on a new planet with new terrain, different climate and totally different constellations is something else.
To put this in 21st century terms - sending or not sending support to the war in Ukraine or Israel is diplomacy and not a Prime Directive matter. Israel, Palestine, Russia, and Ukraine know and understand and have relations with the rest of the world. In contrast, interfering with the people on North Sentinel island is a violation of the PD because they are barely aware the rest of the world exists and they use force to prevent expanding their knowledge of the outside world.