Can religious belief and religiosity act as a barrier (or a proscription) against delinquency, crime, drug and alcohol use, and other criminal or immoral activities?
In order to answer this, we have to look carefully at the wording of the question. Since the question asks if religiosity “can” act as a barrier to our doing various things that are immoral, the answer can only be “yes.” It is possible for religiosity to prevent people from doing bad things. However, if the question had asked if religiosity “does” act as a barrier, the answer would be “not always.” In other words, religious belief can prevent people from acting poorly, but it does not always do so.
Religious belief can make people less likely to engage in negative behaviors. There are at least two possible reasons for this. First, religious people might fear that they will be punished for behaving badly. They might fear that God will punish them in the afterlife if they do bad things. This fear of punishment will prevent them from negative actions. Second, religious people might want to act well for more positive reasons. They might love God and want to act in the right way simply because they want to make God happy. They are not acting correctly out of fear but out of love.
However, neither of these reasons can actually prevent all religious people from acting badly at all times. Religious people can be tempted to act badly and that temptation can overcome either of the forces that push them towards right actions. Religiosity can actually cause people to act in evil ways if they believe that their God wants them to do so. We have recently seen many instances of terrorism that is inspired by religious belief. Such actions are clearly (from our point of view) immoral and yet are done by people who are intensely religious.
In these ways, we can say that religiosity can be a barrier to bad behavior, but we can also say that it does not always act in this way.