Likely, the person who attacked the Mosque committed a hate crime and they also likely have a mental health defect. We don't know very much about why the person did what they did yet, but there aren't a lot of innocent explanations for attacking a Mosque. The person like has prejudices.
There's no way at this juncture to give an answer to this debate question. And a guess is not going to help the situation. No one knows all the facts at this time, so how can the general public make an educated guess or give an opinion. It might stir up a lot of conversation, but more facts have to be presented.
I believe that the tragic attack at the Quebec Islamic Cultural Centre was definitely related to culture and religion. In today's environment, many people fear Muslims. This is an act of terrorism that should be treated as such. Just because we do not agree with someone's religion does not give us the right to target them.
No, it wasn't motivated by any sociocultural imperatives or economic or political dissent. It was motivated by hate and fear, at its root. All shootings are motivated by a lack of love or compassion for others. This one is no different. The shooter has some warped ideas about the victims.