I agree with both you and davidw that loyalty towards a country is wrong from a formal point a view, but since humans are not entirely rational beings one cannot deny that the random entity you happen to get born into shapes a big part of who you are. Hence, the loyalty to the group of other people 'like you', whatever that means.