This was a central part of liberal baby-boomer common sense when I was growing up, especially if you came from a (still) dominant country like Britain. Moreover to show any sense of national feeling — apart from contempt for your national traditions — was a sign that you lacked political sophistication.
I now believe this is mainly nonsense. Nationalism can, of course, be a destructive force and we were growing up in the shadow of its 19th and 20th century excesses. In reaction to that most of the civilized world had, by the mid 20th century, signed up to a liberal universalism (as embodied in the UN charter) that stressed the moral equality of all humans. I am happy to sign up to that too, of course, but I now no longer see that commitment as necessarily conflicting with belief in the nation state. Indeed I think many anti-national liberals make a sort of category error — belief in the moral equality of all humans does not mean that we have the same obligations to all humans. Membership of the political community of a modern nation state places quite onerous duties on us to obey laws and pay taxes, but also grants us many rights and freedoms — and they make our fellow citizens politically "special" to us in a way that citizens of other countries are not. This "specialness" of national citizenship is most vividly illustrated in the factoid that every year in Britain we spend 25 times more on the National Health Service than we do on development aid.
Moreover if the nation state can be a destructive force it is also at the root of what many liberals hold dear: representative democracy, accountability, the welfare state, redistribution of wealth and the very idea of equal citizenship. None of these things have worked to any significant extent beyond the confines of the nation state, which is not to say that they couldn't at some point in the future (indeed they already do so to a small extent in the EU). If you look around at the daily news — contested elections in Kenya, death in Pakistan — most of the bad news these days comes from too little nation state not too much. And why was rapid economic development possible in the Asian tigers but not in Africa? Surely the existence of well functioning nation states and a strong sense of national solidarity in the tigers had something to do with it.
And in rich western countries as other forms of human solidarity — social class, religion, ethnicity and so on — have been replaced by individualism and narrower group identities, holding on to some sense of national solidarity remains more important than ever to the good society. A feeling of empathy towards strangers who are fellow citizens (and with whom one shares history, institutions and social and political obligations) underpins successful modern states, but this need not be a feeling that stands in the way of empathy towards all humans. It just remains true that charity begins at home.