This is inaccurate, for the most part.
UCMJ applies where appropriate depending on the Bureau a pharmacist or other CO (commissioned officer) is working. It actually does NOT usually apply to USPHS officers. If you're stationed with the Coast Guard- yes, UCMJ totally applies and you may be subject to Court martial wrt the UCMJ (that's how the USCG works, and you're bound by that law). If you're stationed on an Indian Reservation, or Health an Human Services, NIH, FDA, BOP, (you get the picture), etc, you're subject to Federal Law and will be tried in Federal court where necessary. There are legal responsibilities in all avenues of pharmacy, be it community pharmacy, hospital pharmacy, Federal pharmacy, military, etc, and each has pertinent systems of justice, rules, and regulations. But yes, you're required to conduct yourself appropriately as would a Uniformed officer.
The UCMJ is not some 'boogeyman' of regulations. It is quite needed and applicable in appropriate circumstances. But even in the military practice of pharmacy, I don't exactly see your point that it could be 'confining' unless you're doing something unethical, beyond the scope of pharmacy, and obviously wrong. I don't see how this issue even makes the list of possible Pros and Cons for most students and new practitioners embarking on pharmacy careers...