"More of a set of guidelines" Kirk and Picard in unison with a chorus of "Exactly" from every other Federation Officer or Official except any featured in anything involving a speech about the prime directive by that episode's primary cast.
Any good captain knows that's a rule worth breaking. If your options are: a) save a whole planet of people or b) keep your fancy status job in a post-scarcity economy, then you know it's morally worth it to get court marshalled.
Besides, federation prison is just a sunny beach on New Zealand anyway. The worst part is getting stuck in the delta quadrant but that happened like one time.