I think it should be considered that even if standard Federation law would consider relocating the Baku illegal, it's brought up repeatedly that the Federation is currently at war...
Except it isn't. No mention of an ongoing war is made in the movie, and frequent mention is made of events that could only take place after the war is over (diplomacy with the Dominion, the E-E and her heroes engaged in ops having nothing to do with fighting).
it's quite possible that their decision regarding the Baku fell under "if we survive the war, then we'll feel bad about what we did".
Might still apply even if the fighting is over, too.
Timo Saloniemi