How do you rid yourself of a foreign nation that is exercising power over you? Israel chose to affiliate with a more powerful power. Judas Maccabeus sent ambassadors to Rome to seek an alliance.
Rome replied by sending a message on bronze tablets. They acknowledged the pledge to support Rome and any of Rome's allies in time of war and that, in return, Rome was to agree to act as ally to Israel. Neither Israel or Rome would engage in trade with the other's enemies.
Rome, agreeing that King Demetrius had treated Israel wrongly, asked "Why have you made your yoke heavy on our friends and allies the Jews? If now they appeal again for help against you, we will defend their rights and fight you on sea and on land?"
Obviously, the Jews could not see the future.
[interesting point that would not have occurred to me is raised in a note in the New Interpreter's Study Bible: "The author mentions that the ambassadors had to undertake a very long journey to reach Rome, which emphasizes that the relations with Rome did not conflict with Mosaic legislation forbidding alliances with local Gentiles (see Exod 23:31-32; 34:11-12; Deut 7:1-2."
What justification was there for the command not to mix with foreigners? Do we have any justification for it now?