You're right in principle, but in practice this is more a more sensitive matter when you share a border with a country like russia.
What they could do is bar any russian from entering unless they can prove on a case-by-case basis at the border that they are escaping persecution in russia for being against the invasion and need to cross it. I think that would be legal and ethical.
The point of federation is that there are thousands of instances that no monied asshole can just buy and ruin for everyone. If you like that, Reddit,twitter,FB,tiktok are just there...or just join one instance and pretend it is the only one. What is the problem exactly?