If the question is, “can patriotism be justified,” then the answer, clearly, is yes: we’ve got plenty of empirical evidence for that in this very thread. If the question is “can patriotism be logically justified,” the question becomes trickier: what do you mean by logic, in this case? There are a couple of ways I can think of. People might be generally happier if more emotionally connected to their home country, or it might better integrate them in a society where such connection is the norm.
But as you rightly point out: what patriotism does, ultimately, is justify the rather arbitrary, or at any rate contingent, construct of the nation state: you’re not patriotic to your street, or block, or city, or county, but to your country–today, largely, the nation state (few exceptions may prove the rule). Patriotism is a logically necessary consequence of the nation state, because without it, the nation state could not function: its chief feature is, after all, that it separates one set of people from another solely on the basis of geographic, and often merely arbitrary, features. So you must mobilize your populace’s belief in the specialness of your particular state by, usually, inventing myths, traditions, and some kind of glorious history, defining a language and, ultimately, claiming a national culture that on closer inspection usually is anything but. So yes: patriotism follows logically from the nation state. You’re being perfectly logical in feeling attached to the country that “created you,” in fact, you’re following the most important of patriotism’s logics in doing so.
If the question is, however: is it right that I should think so, in a moral sense; is it right that I should rather rally around my country’s interests than those, perhaps, of a larger group of people who have the misfortune of not being my countrymen solely on account of that accidental fact…well, no, it’s not right. Because, as you pointed out, it’s an attachment you would have felt to any other nation state similarly (NO!, I hear the first people scream, because not all nations are so great as mine! Yeah, that’s kinda the point).