I'd say the main difference between OCD tendencies and religious rituals is that the former generally cause stress (even though the actions originate to relieve it) and the latter give comfort (unless taken to extremes).

 

Religion has developed through individuals keen on holding power over others playing on the human fear of death.  Those who can accept that one day their neurons will stop firing and they will cease to exist have no need of religion.