The point of heroic tales such as Gilgamesh was to draw tribute and sacrifices to the temple of Ishtar. The analogy makes perfect sense.

Maybe that's a post facto rationalized reason, as I'm sure it did draw in more tributes, but that's like saying folk tales across the world's sole purpose is to have sacrifices when in reality people just like making up and telling stories. It's like saying the apostles of Christ only spread his message to raise money for the Catholic Church, no doubt that was a side effect but it wasn't the "point" by any means, especially early on where there was no church.