From Lampham's Quaterly:
The centrality of the city in the Epic of Gilgamesh goes a long way toward explaining why it became so important in Mesopotamian culture. City-states of the kind that appeared in Sumer around 3000 bc provided the enduring framework of social life in Mesopotamia for all the epic’s long lifetime and long after it was forgotten.
Whatever the political regime, and whatever the basis of the local economy, the city remained the fundamental building block out of which Ancient Near Eastern civilizations were built. For their populations epic tales of cities in conflict never grew old, and the matter of how kings ought to behave never went away either.