In a number of analyses, I have found that greater religiosity is associated with a lower risk of ever having been arrested, but it is easy to conclude that the correlation is non-causal and simply due to some biologically-influenced personality trait (or traits) like conscientiousness.
The MIDUS study measured the Big 5 personality traits, along with religiosity (importance of religion to self) and having ever been in jail. With jail as the dependent variable and the other six measures as predictors, here are the estimates for a logistic regression model (sample size = 2,262):
Logistic regression coefficients
Negative emotionality .26*
Openness to Experience .59*
* p < .05
All of the predictors except for extraversion and agreeableness are significantly related to jail detention. People who are less emotionally stable, less conscientious, and more open to experience are at higher risk.
Even after taking into account the influence of the Big 5 supertraits, religiosity significantly reduces the risk of time in jail. In fact, the coefficient for religiosity is almost the same size when the Big 5 measures are removed from the model. Moreover, it looks like religiosity is the most powerful predictor in the model (measures are in different metrics which doesn't make it easy to compare them). So according to MIDUS data, the lower criminality of religious people is not due to a greater likelihood of possessing crime-reducing traits (at least the 5 we looked at).