The Federation was always interferring with the cultures and life forms they came across. At what point was it deemed justifiable by Star Fleet Command & The Federation?
The Prime Directive, which is about non-interference in the affairs of other species, has been bent, circumvented, bungled up and violated outright by Starfleet personnel so many times, that I can't think of any kind of consistent policy or criteria behind it.
However, there is a pattern established from TNG to VOY:
- If the civilization is pre-warp, most captains maintain a zero-tolerance policy toward revelation of science, technology or knowledge of outer space
- Away teams are allowed to interact with pre-warp societies in disguise
- Disguised away teams may influence specific events in a pre-warp society provided that that event has no effects on that society's development
- Starfleet personnel are almost never allowed to violate the laws of another society, whether it is pre-warp or not
- When the life/lives of crew members are danger, Starfleet captains do have a tendency to try to circumvent the local laws (only if the society is warp-capable).
- Sometimes senior officers will turn a blind eye to minor violations by crew members who are either trying to defend themselves or help a local.
- If a crew member is in danger from pre-warp society, some Starfleet captains (and senior officers) have been known to use technology (such as transporters and Phasors) under the guise of supernatural phenomena already known to the locals. In this, however, they could be risking court martial
- Starfleet sometimes takes covert actions to protect pre-warp civilizations that are at risk of destruction (especially planet-wide destruction)
- The Omega Directive rescinds the Prime Directive while it is in operation
All these people have violated the Prime Directive more than once: Kirk, Picard, Riker, Worf, Janeway, Tuvok, B'Elana.
What we see gotten away with as "not really violations":
- Culture is already contaminated by contact with other spacefarers (TOS, TNG)
- Members of the Culture have made contact, and world is in distress, but isn't ready for open contact (TNG)
- Culture is approaching spacefaring, and is being observed, but members of the observation team/party are discovered (TNG)
- Craft has crashed and natives found craft with crew. (Voyager)
- Destruction of evidence of Federation civilization. (TOS, TNG, Voyager)
- Culture has become stagnant due to subjugation to machinery (TOS)
The Prime Directive is mostly about not contaminating local cultures, not about non-contact with them. The Iotians (TOS: A Piece of the Action) were previously contaminated by the Valiant's crew; Kirk was not violating the prime directive since they were already aware of and ready to interact with spacefarers... his violation was leaving a communicator dirtside.
In one of the TOS movies, an entire civilization is moved... while the natives figure something is up, they don't know it's spacefarers. No violation. In another TOS episode, wholesale alteration of climate is engaged in... at the request of a local... she's then kidnapped, memory wiped, and returned, to prevent altering the civilization.