Invasions aren’t as a category of thing wrong.
Take Babylon invading Israel.
Why did they invade? A judgment of God? Sure but that wasn’t Nebuchadnezzar’s reason for invading, and he was no choir boy. Israel had broken treaties with Babylon and made alliances with Babylon’s enemies. And they were right there on their border. It was untenable for the super power of the day to have an ally with Egypt right on their border. So war. And God picked a side.