Well, while it was the foundation of our society, it is certainly not a necessity. We evolve ethics with or without religion.
Ah, but we gained almost all of the moral and cultural aspects of today's world from religion in one way or another. I'm not saying it was necessary for survival, no, but for what we were, are, and will be it certainly was and nothing can change that.
But of course, in this day and age, a person can have strong morals without
direct influence from religion. That is to say that a person doesn't necessarily have to belong to a religion or have Faith in God to be a good person.