Okonkwo is a hypermasculine warrior, a leader with a few titles in his tribe in Umuofia, and he is no beginner when it comes to killing. However, both the killing of Ikemefuna and that of Ezeudu's son feature prominently in Okonkwo's character development in the novel.
Ikemefuna is a boy taken from another village—basically as a hostage. He is not killed right away, though and grows up next to Okonkwo's eldest son, Nwoye, for three years. Okonkwo comes to like the boy (more than his own son, really), but he is determined to go along when the Oracle decrees that Ikemefuna is to be taken beyond the village limits and killed. He is advised against doing so, but Okonkwo is afraid of looking weak. When the sacrificial killing begins, as one of the tribesmen cuts Ikemefuna from behind, the boy looks to Okonkwo and calls him father.
Okonkwo is emotionally affected, but instead of showing his grief, he decides to take his machete and finish the killing himself. This is seen as extreme and harsh to his fellow tribal leaders. Okonkwo feels out of sorts for a while after the boy's death, but his public demeanor leads people to think he is heartless and unaffected. While Okonkwo's act is frowned upon by other leaders, he has technically not committed a crime because he was following the Oracle. He is not officially punished for this act.
The killing of Ezeudu's son, on the other hand, is totally accidental. He is at the funeral of Ezeudu with the rest of the village and one of the shots he fires from his gun accidentally hits and kills one of the sons as he is participating in one of the funeral rituals. This is labeled a "feminine crime" because it is unintentional. Okonkwo is exiled for seven years to his mother's village, Mbanta. Clearly, this act of committing a "feminine crime" is ironic, since Okonkwo cares more about maintaining his masculinity in front of others than anything else. In the killing of Ikemefuna, for example, his action is motivated by his desire to not be "thought weak."
Based on these examples, the law in Igbo culture is based on the society's perception of the gods. The fact that Okonkwo is exiled is aligned with the belief that his unintentional killing is "an offense on the land" which then has to be cleansed. It is considered just that Okonkwo be sent to his motherland for committing the "feminine crime" and that he must stay away from his village for seven years to allow the land to be cleansed.