Edited to Add: Howdy and welcome, Instapunderati! Thanks for stopping by.
Old-World cities had walls. That was part of what defined a city – it could defend itself. Its residents had a duty to defend it as part of their being citizens. (And I’ll note that this applied to women as well, at least in some of the Imperial Free Cities. Women who had the right to do business on their own also had duties for defense.) A city without walls wasn’t a real city, it was just a place where a lot of people lived at the mercy of any group of armed men who happened to be passing by.