The above statement is not quite accurate. There is no article in the UCMJ that addresses this issue, at least directly.
But members are bound to avoid partisan political activity, largely because of the color of authority. Same reason the fraternization rules exist, although that is spelled out in the UCMJ, and gambling with subordinates.