Yes, of course it's ok. The role of a government is to do what is in the best interest of its citizens. If there is a possible threat from a foreign adversary, the government should deal with it.
There's a difference between the government banning an app from a country entirely, and banning anyone in their military from using an app or even a smart phone or anything with a camera, especially inside a military base!
Yes. I was agreeing with the parent comment that the social media platform is irrelevant. Presumably, video taken of secret military hardware is not ok in any circumstance. It's the smartphone, the attached camera, and the individual that is at fault.