In Washington electrical certification is state wide and no other certification (or license) is required.
Your question should be directed to those cities who do licensing.
What type of license are you talking about? A master electrician license is statewide. But many counties make you buy a local business license to pull permits. Most counties around here just make you have a contractors license, master license, and a local business license. Caroline County is one example that will not accept other counties business license. County of albemarle will not accept a tradesman card, only contractor's license with designation. So you always have to be prepared when pulling permits. Permitting process can be a pain in the butt in the City of Richmond also.
Most major cities have this. Beverly hills and El Sugendo make you put a sticker in the window of your truck. If they catch you working in their town without the sticker, even if you have one, you get a fine.
It's probably in the charter when they incorporate.
Or.
A plot by the man to keep us down, and stop us from moving around.