Almost certainly purely cultural - look at the huge difference in reputations between how friendly places like Glasgow and Edinburgh are even though they are actually ~75km apart.
My experience has been that people sort themselves into different cities according to their preferences, so there could very well be a genetic component as well.