There is absolutely no credible, facts-driven research to suggest that lack of wealth, access to health care, access to mental health care, or access to education have a direct correlation to individuals joining terrorist groups or the rise of such groups. It's just a common trope repeated because it fits with people's existing ideologies. Terrorism is much more complicated than that.