The nation state is—in its fundamental nature—a free and tolerant political system. National loyalty requires only fondness for a geographical location (and its history) which can be acquired by anyone who moves to a nation, as well as those born and brought up there. In principle national loyalty requires no significant revision of values, nor does it exclude people on the basis of their family, colour or any other unsavoury criteria. It is, taken on its own, a remarkably benign form of attachment.
Loyalty is necessary for political institutions to uphold their laws. Laws protecting private property, free speech and so on do not hold sway because they have been written down by a legislator but because those subject to them believe they are authoritative. This requires general acceptance of their content and the body charged with enforcing them, which in turn requires a loyalty and trust for that body and for other citizens. In non-nationalistic countries such as Kazakhstan trade can't rely on its participants' having particular reason to trust one another. Nationalism avoids such pitfalls by enabling a trust of a pool of strangers – something which characterises flourishing societies.
The strongest ties among humans have proved to be religious, tribal-ethnic and national. They are typified by attachment to that which is familiar. The first two of these however, when elevated into political form, are intolerant of differing values and of differing bloodlines. The conflict between family love and religious obedience has characterised some of the worse strands of the Middle-East's history. In Africa tribal loyalties have underpinned devastating atrocities – in the 1994 Rwandan genocide for instance the Hutu people massacred the Tutsi (a group seen to have different physical characteristics). Twenty-two years earlier the Burundi Genocide had seen a reversed tragedy. Similarly fascism is not an extreme form of nationalism but an extreme form of tribalism—members of Hitler’s Aryan race were identified by their appearance and bloodline, not their attachment to a particular nation. We would do well to celebrate our often mocked pride for the rolling hills. Other attachments have proved much less tolerant of our differences and freedoms.
Another reason is philosophical. Where we happen to have been born and brought up is certainly arbitrary from a moral point of view – but this is no good reason to rule it out as mattering. Which mother we happen to have been born to is arbitrary, and yet no one claims we should shun her on that basis. Similarly we come across our friends arbitrarily, even if they have been chosen carefully from those we’ve met. My point is not that we should consider important all aspects of our lives that aren’t up to us, but rather that their being arbitrary shouldn’t be a reason not to think them important. In other words, arbitrariness should give us no reason to feel uneasy about the benefits that national attachment brings.