According to Saxo Grammaticus, in medieval Danish law when a foreigner slew a Dane, two foreigners must be put to death.
Disproportionate penalty was seen as justice because foreigners lacked the same kinship and legal protections (weregild) that Danes enjoyed, so the society mandated a harsher, collective penalty for them. They believed rulers owed their people an uncompromising deterrent to prevent outsiders from disturbing the peace or assaulting native Danes.
Something to think about.