I imagine there’s something in the Military code of conduct prohibiting this. I worked around sailors for 30 years and they all pretty much kept their political views to themselves.
https://www.defense.gov/ask-us/faq/Article/1774809/what-is-the-policy-for-participating-in-political-campaigns/