I've just finished reading a really excellent book called "The Happiness Hypothesis".
Towards the end, the author quotes a fellow academic who explains beautifully why this whole "peace-and-love-religions-practicing-mass-violence" phenomenon makes perfect evolutionary sense.
I'll try and sum it up:
We have evolved to be competitive to ensure the survival of our genes. This obviously works for individuals, and also for extended families/tribes.
However, we have also evolved a predeliction for "ultrasociality" - effectively forming larger communities like cities and nation, giving us advantages in defence, commerce, etc.
Within these large conglomerations, "selfish" genetic competition can be counter-productive. But.... those of you who have read their Dawkins will know about "memes" - cultural traits which are not in any way "genetic", but are subject to natural selection just as if they were. This includes fashions, ideas, etc. - and religions.
The theory is that religions have "evolved" in order to bind larger communities together, based upon shared myths, practices, etc. These "religion memes" are in effect in competition with each other. So from an evolutionary viewpoint, it actually makes perfect sense for them to violently oppose each other. Interestingly, part of this process usually involves a taboo on "marrying out" of one's religion or caste, so that any minor genetic mutations will stay within the group, and cultures may over a long period actually become more physically/racially/genetically diverse. Which in turn is used to instensify the "they are not like us" attitudes.
That's massively oversimplified the idea, but it makes a lot of sense to me, and I intend to read further.