Originally Posted by Uncle Buck
Off the top of my head, I do not remember what article of the UCMJ covers it, but there is a catch-all article in there that covers "Prejudicial to good order and discipline."
Article 134, the General Article:
“Though not specifically mentioned in this chapter, all disorders and neglects to the prejudice of good order and discipline in the armed forces, all conduct of a nature to bring discredit upon the armed forces, and crimes and offenses not capital, of which persons subject to this chapter may be guilty, shall be taken cognizance of by a general, special, or summary court-martial, according to the nature and degree of the offense, and shall be punished at the discretion of that court.”
Anything that was not listed as an offense in Articles 77 thru 133, fall into Article 134.
Which is why, if you are wearing your uniform and/or identify yourself as a member of the Armed Forces, your rights are very limited. Everything you do is subject to military discipline.