You would think that a war story with vivid descriptions of death and bloodshed would have an anti-war message. But this is most certainly not the case with The Iliad.
Homer was not at all against this war or any other war. In fact, one of the major themes of the epic is how heroic and glorious war is.
Even so, he did not shrink from portraying the horrors of war. In my opinion, this is done in part to reinforce his point. If war were easy and risk-free, excellence in war would be pointless. But because war is so terrible, it is glorious and honorable to be a great warrior.
So, the scenes of carnage are there to show us what the stakes are -- what the heroes have to lose. This allows us to realize how glorious their victories really are (to Homer).