> they earned their money legally
"Legally" is a vague term. What's legal today can become illegal tomorrow and vice versa. What is legal depends entirely on who gets to define and enforce the meaning of the term.
That enforcement can happen in two ways. Either because individuals acknowledge that the state holds a monopoly on violence in return for lawful order through a social contract, or individuals get effectively subjected to violence coming from a stronger individual or group of individuals.
> And yes, they already paid tax on said money in the country they earned them.
You're appealing to a principle of fairness. However, such principle only applies if those who get to define the rules are willing to accept and enforce that principle. Either because there's a large social consensus, or because enlightened despots are in power.
A universal principle of fairness does not exist.
Society at large isn't rational. It's a collective that spawns irrational, often conflicting views and beliefs. And the net result is, in the best of worlds, an uneasy compromise. If the large majority of a community feels that an exit tax is a fair principle, then that's something you will have to accept unless you find a way to convince people of the opposite view.