In the 1960's an Army Dermatologist named David Levy was assigned to go to a field trauma and surgical hospital Vietnam after being identified as one of the participants in a peaceful, off-base, off-duty, protest in El Paso. He was out of uniform and not distinguishable as military (other than perhaps by his haircut) when on the march.
Aside from the questionable usefullness of having a dermatologist in country (and at a trauma facility set up to handle triage and treatment of transient surgical cases, no less), the Army was very up front about why they chose him as the next doc to go . . . he had pissed them off.
When he made a stink, contested his orders, and (horrors) went public to the N Y Times with his story, they court-martialed him (bringing discredit on the service). He ended up doing a year in Leavenworth rather than at some detachment outside of Da Nang.
Freedom of Speech? I think not.