It was absolutely motivated by religion - the Islamic state IS their religion.
Of course no connection is made here:
Non-White murderers are given the luxury of being lone wolves or insane. White men are racist homophone misogynist nazi colonizers