I will fully agree with you on greed, however. And I'd even go as far as to agree with you on religion being a tool rather than the real factor. But there's also another thing you're missing on the religious issue. The terrorists in Xinjiang killed hundreds of completely random people - and often in close contact with weapons such as knives. Well random in at least they tried to target non-Muslims. That's something I think the vast majority of people simply could not bring themselves to do. That just takes a whole lot of hate, or at best complete sociopathic disregard, for somebody you know absolutely nothing about. And religion, fundamentalistic religion in particular, is something that helps breed that hate. And it also lets people believe that after they go kill those random people, somehow they're going to end up in a magical place where until the end of time they get to go screw 72 perpetual virgins while being served by 80,000 servants. Haha. Maybe we've come full circle and the religion itself ties right back into greed!
What about population pressures? What about religous disagreements, what about nationalism? Old grudges?
Why can't fundamental belief systems be part of the substrate of this equation that results in war. They change every other aspect of life and politics in many cases.