Many ancient poems tell us a lot about morality - good and evil. This is certainly true of the epic of Gilgamesh.
First, at the beginning of the work Gilgamesh was a ruler with many abilities and he created an amazing civilization. But the problem was that he had no moral scruples. He might have built something amazing, but he did so by the oppression of his people.
He would also take whatever he wanted, even people. He raped many women and he would take women from his warriors and noblemen, if these women caught his attention. An unjust ruler is what he was. This shows that power corrupts people. Kings can become tyrants and despots. So, the people cried out to the gods and the gods heard their prayers and raised up another man to challenge him - Enkidu.
The raising up of Enkidu shows that within the work there is an idea of divine justice. The gods are in charge in this theistic worldview. Many today also believe this.
The fact that Enkidu is able to change Gilgamesh shows that change is possible. In fact, at the end of the work, Gilgamesh is reformed, which shows that good triumphs in the end.
In conclusion, the epic teaches us that evil is real with serious consequences.