Sigmond Freud said, “The more the fruits of knowledge become accessible to men, the more widespread is the decline of religious belief.”
Adi Shankara called the spiritual path the path of discernment. As one discerns, ones understanding evolves. To evolve means to change. If one clings to old understandings, discernment ceases and evolution is obstructed. Dogma then prevails. If that is done, religion stagnates and is then rejected by those who discern.
Use knowledge to evolve your spiritual understanding. When done with wisdom, humility, and grace this process does not mark the decline of religion but the blossoming of it.
To discard the old all together is to throw out the baby with the bathwater, but to use knowledge to evolve ones understanding is to separate the wheat from the chaff.