With all the recent excitement about a book to argue the thesis that sin can be a cause of atheism us believers need to not get too excited. It is worth remembering that, while some manifestly have turned away from faith because of moral failure, others have turned away from faith because they were too moral to accept what they felt their faith demanded of them, whether in terms of action, attitude, or belief.
Not only that but moral failure is often a catalyst for people to find faith as they come face to face with their own moral bankruptcy and seek redemption. However, a church that is full of judgmentalism will succeed in creating atheists both through moral failure and moral virtue and will also prevent those seeking redemption from finding it there. That is why the Lord told us to take the plank (judgmentalism) out of our own eye before we dare to address the dust in the eye of another.