Here is how the US responded to the Solomon Islands military treaty with China (emphasis mine):
> If steps are taken to establish a de facto permanent military presence, power-projection capabilities, or a military installation, the delegation noted that the United States would then have significant concerns and respond accordingly.
Note that the Solomon Islands is also a sovereign nation, and that it is > 10,000km away from the US border, and >2000km away from the border of the closest US Ally, Australia.
My point is not whataboutism, it is that sovereign nations have an interest in the military alliances of other sovereign nations, and that the security of one state doesn't stop at its borders. Joining hostile military alliances or massing troops at a shared border is logically viewed as a security threat from another nation, and sovereign nations have a right to attempt to prevent such actions.
Of course, doing it by force of arms the way Russia did is entirely illegal and immoral. Even the threat of violence is considered unacceptable by the Geneva convention, though of course that is often ignored. But complaining or seeking diplomatic and even economic ways to prevent such actions is not immoral in my view, and it is certainly not unusual.