This one's actually fairly simple: militias.
I've written quite a lot about militias but what's important here is that serving in the militia had become a ubiquitous social obligation for citizens in cities and towns, and that that obligation extended to owning arms and armor required, at risk of incurring fines.
While there was a parallel social expectation that you'd practice and serve happily when you needed to - mostly this is for a regular rotation in the night watch - this was also, as you can imagine, not a terribly popular burden, and citizens very often hired semi-permanent replacements - such as gate or tower guards - or personal substitutes to serve their rotation. The increasing reliance on substitutes helped to create, in some times and places, semi-professional, semi-permanent guards known as reliable to the local community.
So, halberds. The arms and armor required for militias, even if they were mustering to fight fires, would have been the kind that were considered suitable for use on the battlefield, and typically required a polearm, a sidearm, and some kind of armor and helmet. By the second half of the 15th century, the polearm was usually a halberd. You'd wear your armor and lug around your halberd if you were doing typical watch stuff, even just tramping up and down the street calling out the hour. Gate guards or tower guards, men who might be citizens or hired men, would have been at the gates and towers 24 hours a day, in armor with halberds.
By the mid 16th century, most of the militia requirements changed as battlefields changed, and halberds were usually replaced with pikes. But there was still need for halberds, and halberds stayed in town militia requirements because they were more useful for fighting fires, and because they were more comfortable and useful for guard duties - imagine trying to break up a brawl with a pike. And this usefulness extended to privately-hired guards. Private guards had a responsibility to protect their client, on battlefields and in private, and since that meant spending a lot of time in houses or churches or palaces or what-have-you, carrying a pike would have been more of a hindrance than a help.
So around this point, the halberd had already had a long association with on-duty guardsmen - which was important in contexts, like free cities in the Holy Roman Empire, where nearly every male citizen was regularly publicly armed - and when pikes became more useful on battlefields, halberds remained useful with guards of various kinds, because of its usefulness in public contexts, and that signifier was carried out even onto battlefields, a halberd marked you out as a man of distinction, even if you were just part of a commander's or bishops' or rich man's retinue.