Again, it's simply a rule created so you can violate it. TvTropes says it best:
http://tvtropes.org/pmwiki/pmwiki.php/M ... eDirective
TvTropes wrote:
"Starfleet -- the military arm of the Federation -- claims to observe a "Prime Directive" not to interfere with other species. But all they do is interfere!"
- Klingon Commander Dorak, on the Federation.
This trope involves any code of conduct that artificially constrains the choices available to the protagonist. Often (as with the trope's namesake), it restricts or prevents his use of phlebotinum that would wrap the plot in two seconds otherwise. Conveniently forgotten (or handwaved) when the plot requires it, but some shows do try to use this as a point of plot drama as the protagonists try to find a way to twist the rules to fit the situation.
The Trope Namer is Star Trek, which gave us the "Prime Directive of Non-Interference". It's reproduced in full further down the page, but the short of it is, "[If] the Rubber Forehead Aliens of the Week are sufficiently primitive, [then] do not alter their culture in any way, shape or form." It exists because, in the words of Jean-Luc Picard, "History has proven again and again that whenever mankind interferes with a less developed civilization, no matter how well-intentioned that interference may be, the results are invariably disastrous." Having said that, Gene Roddenberry is on record that, all moral pontifications aside, the Prime Directive was mostly a Rule of Drama: do we screw the rules and do what's right? Star Trek being what it was, the answer was often "Yes", and generally the crew managed not to bungle it either.