This is a very difficult question, as the epic is very long and there appears to be no one overarching theme or moral. In light of this, scholars have many differing opinions, when it comes to the main moral of the story. In light of this, we need to be open to what we think is the main moral of the story. What we need to do is though is to show the evidence of why we hold a certain opinion.
In my opinion, the whole story is about the dangers of pride. We see this in a few ways. First, we see the pride of Achilles as he holds out and does not enter into the battle. This costs many lives and almost the loss of the Greeks. We also see the pride of Agamemnon. He cannot take the fact that Achilles is a better warrior than he is. In addition, we see even the pride of Hector. He knows that Achilles will defeat him, but he has to fight him anyway. In the end, all of this pride leads to death and tragedy.
As readerofbooks suggests, there may be many morals in a work of such length and complexity as Homer's Iliad. As his post also suggests, "the costs of pride" can be argued to be the central moral of the tale. I would offer the idea that "right action" is the central moral of the epic poem.
By "right action" I intend to refer to the idea that one's essential nature determines both one's social status and a resulting mandate for certain behavior in the context of Homer's Iliad.
There is a notion at work in the poem that is closely related to the idea of dharma - who you are, at root, determines what is "right" for you to do. What one can do and what one is allowed to do is a function of one's essential being, which is reflected in one's social status. Morality and identity are closely linked.
In the ancient Greek context, position is very important. We notice that the range of one's abilities is always equal to one's stature. One's "rights" to property and one's range of acceptable behavior are also roughly equivalent to one's stature and abilities. Thus, Zeus can do whatever he wants. He is so powerful as to be the determining moral factor, as it were.
This notion of "right action" is, arguably, the root of all the action in the narrative and also serves to generate nearly all of the conflicts in the tale - including those conflicts that feature the gods in dispute with one another (Aries vs. Athena, Poseidon vs. Zeus, etc.).
"Hera and Athena are angry at (or even hate) the Trojans generally, and Paris specifically, because he chose Aphrodite over them as the most beautiful even before the war began" (eNotes).
Right action, in the ancient Greek context, is not aligned directly with contemporary views of moral action as we see again and again in the story of the Iliad.
For instance, we can say that the conflict between Achilles and Agamemnon is related to "right action" in the Greek context. As the king, Agamemnon claims a primacy of property rights and so claims ownership of the captive Briseis. This claim to primacy is disputed by Achilles, who is a greater warrior than Agamemnon and who previously had been given the rights to Briseis.
From a contemporary standpoint, neither man has a moral right to claim a slave. In the ancient Greek context, however, the debate about who should own Briseis is tantamount to a debate about who is in possession of the greater "nature" - Achilles, the half-god, or Agamemnon, the king.
The Greek losses in battle ultimately prove that Achilles is the greater of the two. Agamemnon finally yields. Achilles takes the field and kills Hector.
Notably, due to Hector's stature, the Achilles agrees to honor the wishes of Priam and allow for full funeral rights and a period of mourning. Hector's status thus determines what is "right" in the situation - or what consideration is due to him. Right action and due consideration are, again, given an equivalency here.