How so? You leave, they stop paying you. Any funds for retirement is your account. You leave the country and renounce citizenship, you no longer get the benefits of citizenship which includes social security. That seems pretty fair.
And yes a company doing that is a completely different situation. Like it or not we pay into a pool that if you are a citizen you will receive benefits. You also pay into an account for your 401k that you own. Renouncing citizenship, you walked away from the former account.