Undoubtedly religion have been used by groups and individuals with power to make the common people behave as they want them to and accept what they want them to. It can only be used this way if the people already believes – what does the proletariat care what a God they do not believe in commands of them! This view of religion can explain many aspects of religious beliefs as they occur in society – why, say, Catholicism has contained so many dogmas and ideas that are far away from the bible and the word of Christ. But as an explanation for why religions exist in the first place it does a poor job.
An important point to make here, that we will be coming back to later again and again: that what one claims a religion to say happens to be suspiciously convenient for oneself does not mean one does not believe it. It does not mean that one consciously and cynically lies. It may be that one really does believe it. That some people cynically use religion and ideologies to their own advantage is beyond questioning, but the extent to which this happens is worthy of questioning indeed. Particularly the idea that large groups of people, even whole classes of society, all conspire together to present a fake image of their beliefs to take advantage of people seems questionable. The greatest cause of immoral behaviour is the sinner’s honest belief that what he/she does is justified or even morally right.