That doesn't have anything to do with religion.
Everyone has an existential crisis in their life, and desires to become a part of something greater than themselves.
The traditional institutions in Western society that promoted this sense of belonging have been eroded in the recent decade, which could explain the trend toward joining organizations like ISIS and their ilk.