Pakistan, Armenia, Egypt and many others are some of the most 'equal' nations in the world. I think people use income equality as a sort of euphemism for Scandinavia, and by most metrics yeah they're doing incredible there. But many of the characteristics they have, which includes relatively low income inequality when discussing matters with somebody with a left bias - and cultural/ethnic homogeneity when discussing matters with somebody with a right bias, are also shared by many other nations that are in awful shape.
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!