The Epic of Gilgamesh, despite many fictional or fantastical elements, is actually grounded in history. Gilgamesh appears as the king of Uruk in the Sumerian king lists. He was a real king and Uruk was a real city.
The first thing we learn is that Mesopotamian religion was polytheistic and anthropomorphic. There were many gods and goddesses, and they had the appearance and character of supernaturally powerful and immortal humans, albeit ones still bearing some association with primal natural forces. The gods mated with each other, had children, and were capable of interbreeding with humans, giving rise to heroes. The gods demanded respect and worship from humans and had an interest in regulating human ethical behavior. They were especially concerned with kings, who were tasked with serving as conduits of divine justice. In the story, we see the evolution of Gilgamesh from unjust to just king and the way the gods enforce the notion that the duty of a king is to deal justly with his subjects, something we also see in Mesopotamian law codes.
We also see a highly stratified society with vast differences in wealth and power determined largely in a hereditary manner. There are also quite distinct gender roles, with women generally subordinate to men. We also see a society that is quite warlike, and which admires physical strength and military skill. The society is also quite sophisticated for its period, showing evidence of urbanization, literacy, and a complex conception of justice. The urban center relies on surrounding agricultural areas for food production.
We can learn much about Mesopotamian culture from this epic. First, we see that one strong male leader, assisted by a counsel of city elders, was the traditional form of government. However, there seems to be a real concern with the rights of the citizens, as Gilgamesh is expected to be a just ruler. The outrage over his abuses actually leads to the creation of Enkidu in the story.
In The Epic of Gilgamesh, the presentation of religion is similar to what Greek and Roman authors would depict a thousand years later. First, the Mesopotamians were a polytheistic society. Many gods are attached to natural phenomena or occurrences: Shamash is the god of the sun (and his wife the goddess of the moon), Ishtar the goddess of both love and war, Ea the god of water and the arts, and so on. This is common in polytheistic religions.
Second, the gods are heavily anthropomorphized. They have relationships, they pick favorite mortals to guide (or choose their least favorite to destroy), and they fight among themselves. When Enlil chooses to destroy mankind in the Flood, Ea saves Utnapishtim by telling him to build the boat. When the Flood is at its fiercest, Enlil is safe within his palace, while the other gods are cowering around the gates, soaking and miserable.
There is gender division suggested in the culture/religion as well. The king of gods is male, which suggests a patriarchal society. Yet Ishtar is a major goddess, controlling both love and war, and the city of Uruk is dedicated to her. Because she controls two aspects of human nature ruled by emotion, we might infer that Mesopotamians associated women more strongly with instinct or emotion than reason.
The images of the afterlife are strange. The underworld is certainly dark, and it appears that all souls alike are trapped underground to shuffle about like birds. Because this is such a fragmentary look at Mesopotamian beliefs, it is difficult to form an accurate picture of their vision of the underworld.