On Wednesday, Secretary of Defense Mark Esper released a memo to the troops reminding them that it's against the Uniform Code of Military Justice for active-duty troops to participate in anything political while in uniform. Obviously, it's not saying that troops can't hold political opinions or that they can't participate in anything while in civilian clothes.
It's just saying while in uniform as it gives the impression all troops support one candidate/policy/movement. Why? I'm so glad you asked my rhetorical question. Because civilians (and I'm taking the politically neutral stance by mocking both sides of the aisle on this one) tend not to know any better. They look at Private Snuffy in his dress blues, and they just see his uniform and assume he's some official envoy from the military because that's apparently the Pentagon giving their seal of approval - which they're obviously not.
It's like how civilians all assume every troop knows every aspect of how WWIII is going to play out. Private Snuffy is clearly fifty levels too low on the totem pole for that kind of stuff, but the civilians wouldn't know. I'm just saying. Even top generals appointed by a sitting president can't even clap during their State of the Union because of this rule, so even they are obviously not going to officially back any politician.