Greediness and love to control are the reason for making wars, they create borders and divide people,
they created racism in order to rule the land and the people inside their land.
The leaders and their decisions are the one causing the wars, some even created religion to
divide people and to use it to rule the land and the people in the land.
While I agree that greed for resources and power is the reason for war, I don't think it is the reason for boundearies between people.
We function better in small groups. Our ultimmate group is the Family. A child can't be raised by the human race. We identify with larger and larger groups, which get less intimate as they get larger. A church is a social group that meets a lot of needs. It gives less materially and defense wise than, say, a national government, but it is emotionally much more intimate. In the same way, a national government is more emotionally satisfying than simply being a world without borders. Basically, we need our small groups, but we need our small groups to get along.
Racism, sexism, "religionism", etc., have to do with our biological predisposition to "us/them" mentality. Research studies show you can randomly assign participants to two groups, have each group schmooze independently for 15 minutes, and afterwards each participant will score their own group as smarter, friendlier, better looking, etc. Us and them. It's so ingrained that if we didn't discriminate on race, religion, sex, etc., we would discriminate based on which end a person cracks their egg.