In ancient times, cities usually had outer walls with gates in them.
This continues to refer to Wisdom, personified as a woman.