Vendettas are extremely disruptive of society, so society evolves rules to handle them. The duel (and the code duello) you mentioned above are one. Scandinavians developed the concept of weregeld where the killer pays the family of the deceased to head off any retribution. These rules and formalities are so important that crime families are known to use similar such to head off general blood baths between them.
I don't deny that societies have laws and rules nor that they are necessary. I am simply pointing out that you cannot define an immutable morality through logic alone. Laws have reasons for their existence which have a logical basis and often a moral basis but the laws differ.