It's a theological trait that was INHERITED from sand people.
Sand people's economies were tribal in nature, resource limited, which involved economies that were centered around warfare and theft of caravans passing through.
Perhaps it makes sense in the sand people's context. You need a moral justification for thinking your tribe is better than others so you can rob them and take their women. They are kaffirs, infidels, etc.
So yes, it's what you said, and that trait gets passed into judaism, christianity, and islam.
But that theological trait, which was designed for sand people, has now found itself in the minds of indian subcontinental muslims for example. A resource rich land where cooperation is possible, and you have an incredibly tribal people believing in desert myths and beliefs not designed for them.