As to the Criminal Code provision, it is clearly an attempt to reconcile freedom of religion with freedom of expression. It is an old provision. The difficulty is that this provision can be invoked even though it has already been demonstrated that the person in question wanted to fuel hatred towards a community.
That proof is required when using that defence.