Hammurabi's code was just.
The Justice of Hammurabi's Code
This was the ruler of Babylonia, who created Hammurabi's code.
This statue is what Hammurabi's code was written on, with the Epilogue. The top is Hammurabi being blessed by Shamash, the god of justice.
Laws 215 and 218
This law is just because the free man received a healthy body, so the surgeon received something as well.
Law 218: If a surgeon has operated with a bronze lancet on a free man for a serious injury, and has caused his death, ... his hands shall be cut off.
This law is also just because the free man lost his life, so the surgeon loses his hands.
The equality I've been talking about is right here. The man gained something, so the surgeon gained something. Or in the other case, the man lost something, so the surgeon lost something.