Belief in God is rational.
Everything has a cause. So unless there is a first cause, then you would have an infinite regress. And then nothing could exist. Therefore there must be a first cause. Therefore God, the first cause, exists. QED. (You could prove the first step a priori that everything has a cause by noting that nothing can come from nothing. This makes it a priori, not just an empirical observation).
The motive was clear. It was to kill infidels. They were to him “foreigners.” This was done in the name of a false god. How much clearer could it possibly be?