First, religion is a social phenomenon, while spiritual practices tends to be individual pursuits that aim to advance the self's life experience, like meditation, yoga, or even chanting and prayer. The two can overlap, but they aren't synonymous.
If people abandon religion due to them becoming better educated then it is likely due to religions making false and irrational claims that are contrary to fact and science. The Catholic Church has gone a long way in adjusting to what science discovers about the universe, namely changing the model of the universe via Galileo, and accepting evolution. Conservative Christians tend to believe in creationism which is a false and fraudulent business product. The believers are exploited and they can't seem to understand how they were taken advantage of.
Still, the core ideas of Christianity are absurd and non-factual, so difficult for the most reasonable people to accept. Any claim of a God existing is pretty far-fetched, and no claim can be supported by evidence and reasoning. It is to be expected that skilled, critical thinkers will be well educated, so it's more of a correlation that a thinker rejects religious claims and also is educated in science.
As noted religion is a social phenomenon which is why you will find citizens in the West most likely to be some sort of Christian, and people in India will be Hindu, and people in the Middle East will be Muslim. Citizens will tend to adopt the trends they are taught are true. Even those with criticsl thinking skill may hold on to religious beliefs for the sake of family cohesion, or even personal identity.