What’s the cause of religious terrorism?

Last Friday, David Cameron said this:

The cause is ideological. It is an Islamist extremist ideology: one that says the West is bad and democracy is wrong, that women are inferior and homosexuality is evil.It says religious doctrine trumps the rule of law and Caliphate trumps nation state, and it justifies violence in asserting itself and achieving its aims.

He went on to argue that this is “something that is quietly condoned online or perhaps even in parts of [the] local community”. But today, in response to today's shootings in Tunisia, Cameron says this:

The people who do these things, they sometimes claim that they do it in the name of Islam. They don’t. Islam is a religion of peace. They do it in the name of a twisted and perverted ideology that we have to confront with everything that we have.”

Well, which is it? You can make a strong case that religion itself is an inextricable aspect of religiously-motivated terrorism. Equally, you can say that violent extremism is a bug, not a feature, of religious faith.

But it’s difficult to claim both one Friday and the observe the week after.