An example of another metaphor like this is the image in King Nebuchadnezzar's dream. The Rock that was cut without hands hits the feet of the image, and, of course, the images does not prevail against it (Dan 2:34). Another example is the Chief Cornerstone that grinds to powder those on whom the Rock falls (Matt 21:44)
The Rock in both these examples is clearly the Christ, and I think these metaphors are all related. The gates of hell must certainly represent all of hell and death itself and more. In antiquity, the gates of a city not only represented the defenses and entrance of a city, but also important places of civil government and commerce. See Deut 16:18 and Ruth 4.
Therefore, the government of the godless (in the image of Nebuchadnezzar), the wickedness of the builders (who rejected the chief cornerstone), and place of hell itself (created for Satan and his angels), are all encompassed in the gates of hell.
In the second death, Hell and Death are thrown in the lake of fire. See Rev. 20:14. This will be the final fulfillment of Matthew 16:18.