Patriotism is often presented as a dangerous slope to nationalism, closure to others and in the end the main cause of wars.
An alternative analysis is to remark that many wars started because of a limitless desire of expansion : a "pan-something", pan germanism, pan sovietism, sometimes pan americanism, the desire to rule with extra territorial power and law.
The notion of homeland then, appears as the opposite of this greed for expansion. It goes back to its ancient meaning : the Ulysses one, the Ithaca reasonable size opposed to the trojan hazard, the greek right balance of what is at human scale.
Many debates presenting the "good" as opened and the "evil" as closed are rather simplistic. Extreme openess can hide an unlimited desire of domination. The "opened society" is much more about a right balance between our native culture and the encounter of other cultures, than a vague and formal principle.