Rather than asking if it's necessary which is quite broad, I'll narrow it down with this.
I, as an atheist, believe that most children are in great care under religion. I am going to admit now that some have been victims of child molestation before and even some unsolved cases in the 19th century have been brought back for further investigation. Corrupt power monsters of religion I comment. Most have stuck and upheld to religious teaching. I was once a three time Bible contest champion and a firm servant of God. Religion had blinded me and kept my full logical potential with all the lies but I was able to break free. Of course I was enraged but I can't blame any religious teacher if they end David's story with simply "David beat the Giant" because I myself wouldn't ruin a child and tell him about incest and foreskins and how Goliath's head was cut off like some object of prize for God's glory.
Nevertheless, it's really difficult to explain morals and logic to a child without the aid of religion. It's difficult to control them without scaring them with hell and Jesus being mad. There's prayer to strengthen their focus and meditation capabilities and clear their mind.