After seeing a similar question regarding Baldr's death in Norse mythology, I thought this could be a good question for some experts on Mesopotamia.
I just read through a translation of the Epic of Gilgamesh, and it fascinates me because the main character is often described as beautiful, strong, and so on, but isn't exactly a good person by modern standards if we just look at what he does in the story. Did the ancient Mesopotamians view it any differently?
There are, obviously, cultural differences in how the good has been specified, and you are correct that myths/legends can be a great window into how a given culture thought about the good. So, for example, we might look to The Death of Arthur to learn about the ideals of knighthood, chivalry, and kingship in Medieval France. And we can do the same with Beowulf, The Illiad, silver age Superman comics, etc etc. Gilgamesh is no exception.
One way to think about this sort of project is in terms of virtue theory. According to virtue theory, to be good is to hit the "golden mean" within some sphere of human experience. So, to be courageous is to find the ideal point between cowardice and rashness, and so on and so forth. The cultural differences we observe, then, correspond to different ways of specifying the virtuous mean. In this way, we can make sense of (and respect) cultural differences without giving in to some sort of wholesale (and therefore unpalatable) relativism about morality.
So, what does Gilgamesh tell us in this regard? Well, for one thing to proper attitude for men to take with respect to the emotions seems clearly different, provided we take Gilgamesh to be an ideal man, not just an ideal King. He loves, hates, and despairs with what seems to many modern observers a reckless abandon. The modern ideal is more stoic -- one should not give into one's emotions. Gilgamesh appears to see something valuable in feeling and expressing emotions deeply an honestly.
One's worth is also closely tied to martial accomplishments. Enkidu and Gilgamesh seeks to perform great feats in order to show their worth, to acheive renown, lasting fame and respect. This perhaps isn't too far from some modern tendencies to attach one's worth to how wealthy one becomes. Still, the sort of open, heroic praise of violent acts as constitutive of morality/self-worth strikes some as jarring.
Hopefully this is helpful as a starting point for thinking about legends as a window to the moral views of a culture, though I fear my limited knowledge of Mesopotamia in general prevents me from being more helpful.