STAR TREK was filmed before we had rigid speech codes forbidding any utterance that anyone might take personally. Nowadays the rule is "Watch what you say."
That isn't the point. Starfleet was conceived and presented as a military or quasi-military organization. In the military, outright disrespect to one's superiors is insubordination, which can draw anything from a stern lecture to extra duty, suspension of privileges, docking of pay, time in the brig, or reduction in rank.