Examining the premise
If later the thus raised people leave the country to work abroad, then this is economically quite disadvantageous to the home country.
if I move abroad, my parents won't get a pension from my taxes.
These aren't necessarily true. Some people move and send back money. Since they often live in a richer country, even a low portion of their income can significantly help those that stay behind. It's possible that the repatriated money might be more than the potential salary if the person stayed. And they pay in the new country's currency, which the original country often needs to buy goods.
If I send money to my family in another country, they then use that to buy goods. Either they buy the goods from the new country, saving local resources, or they exchange the new country money for the old country money. Either way, they expand the resources available to the old country. That helps regardless of money flowing to the government. The government is just a tool for the good of society, so it should be measuring in how things help society, not itself.
And I wouldn't be so quick to dismiss the helpfulness of not paying for the emigrant's children's education. Give up taxes from one emigrant. Save the costs of educating multiple children. Similarly, the country loses the taxes from one emigrant and saves the costs of providing a pension to that same emigrant. Loses the taxes and saves the transportation, welfare, law enforcement, and other costs of current government services.
In the real world
The other problem is that most countries lack the economic power to insist on foreign residents paying their taxes. The foreign residents would repudiate their citizenships to save money. That's happening with United States citizens now. Some relatively recent changes have led to larger tax bills and expatriation. A more aggressive tax collection may make it harder to switch directions and return to the original country. That would be the reverse of the intended effect.
Looking at the European Union, we might ask about compensating for losses due to moving. Yet that assumes that the other countries want the migrants. The EU rules actually operate the opposite way. They force countries (like the United Kingdom) to accept migrants. Adding a transfer back to the original country to repay educational costs would work against that. The target countries simply wouldn't do it, so it would never get passed. And apparently the source countries value membership in the EU over holding onto the results of their educational systems.
As I said, the US actually does require citizens everywhere to pay taxes. It's part of the cost of citizenship. If we look at the states as individual countries, we get back to the different kind of costs. Would states be better off with more unemployed, uneducated citizens who use state resources and do not pay taxes? Or are they better off with educated citizens leaving and not using services, even though they don't pay taxes? Also remembering that some educated citizens stay.
It's also worth noting that US states only pay around half the costs of primary and secondary educations and less of college educations. The main source of funding for primary and secondary are municipal or county taxes in most locations. The main source of funding for college educations is individuals (parents or the students themselves). Businesses also subsidize education for their employees.
Business subsidies for employee educations are especially relevant here, as they also usually come without strings. Employees can leave at any time and get the subsidy benefits without repaying the employer. Yet businesses still operate such subsidies even though they are only responsible to themselves and not society. Overall, the advantages of the subsidies must outweigh their costs by enough to allow for losses.
Why don't businesses only loan the money to their employees? It's quite possible that their employees wouldn't take the loans as much as they do the subsidies. So their employees would provide fewer benefits from education at lower costs. But if the benefits outweigh the costs, that's a net loss to the business. They are better off wasting some subsidy than giving up some of the benefit.
Countries have the same incentive. It is better to "waste" some subsidy by allowing other countries to take advantage of it than to waste the citizen's potential by not paying for the education. And most countries lack the leverage to force payment from the recipients. Neither other countries nor the individuals will pay.
I get the idea behind this. You want the people who are getting the benefit to pay for the acquisition. To some extent I agree with it. If we allowed schools to make agreements with parents, the schools could have an income tax rate. So I would pay my primary school 2% of my salary and my secondary school 3% and my college 4%. But then how would new schools start?
If I leave primary school at age eleven and then graduate college at age twenty-six, that's fifteen years with little or no income. The school would go out of business. Or it would have to borrow. How would the school get value for its future income streams (against which it would be borrowing)? Meanwhile, it would be competing with schools that already had income from their prior students.
Perhaps parents could loan the money to the school. Then effectively the children would be paying back the parents. But that's part of how things work now. Parents pay taxes for their children's education and when the children are grown, they pay taxes for their parents' retirement. Also consider what happens if the parents die before the money is repaid. The children are then paying money to the schools which then go back to the children.
This might make more sense with colleges. For one thing, they are richer, with large endowments. For another thing, employment often follows college graduation closely. In particular, doctors and lawyers leave college to go directly to work. Or many doctorates get jobs with that or another college. So repayment would start sooner relative to when the expenses were incurred.
In the US, college education is often financed with loans. The government loans money to students who later pay back the money when they get jobs. But sometimes students make bad educational decisions or simply have bad timing and can't find jobs. So students end up owing a lot of money with no prospect of a decent job to pay for it.
Why not have businesses loan the money to students? Not banks but employers. So General Motors (GM) might loan a mechanical engineering student money. If GM doesn't hire the graduated student, then it would lose its investment and the graduate wouldn't have to repay. If the student takes a job with another employer (e.g. Ford) instead of accepting GM's employment offer, the new employer would have to buy out GM's claim or make some other agreement.
Of course, this is the kind of thing that the US or EU could do. It's not something that a poor country in southern Asia, Africa, or South America could do.