Why doesn't knowledge of the obvious causal relationship between consciousness and brains destroy any ideas of an afterlife?

It doesn't.

There are several possibilities here. One is that there is a causal relationship between the physical brain and a non-physical mind, which can still make sense of the idea that when alcohol is coursing through your veins into your brain it causes your conscious experiences to be funky or when a part of your brain is lesioned it causes mental disorders. This view is Descartes' dualism. If it is true, then presumably your non-physical mind (or soul) can survive after your physical body dies (though it's hard to imagine how things would be for your bodiless soul in "heaven"--e.g., how do you find grandma? and what would you do for fun?). This view becomes less plausible the stronger the correlations between brain states and mental states become (the soul seems to have nothing left to do).

So, supposing such dualism is implausible and we assume this evidence of a causal relationship between brains and consciousness is evidence of a physicalist view, one that says the mind just is the brain or that mental states are constituted by brain states, etc. Then, perhaps you are asking how there could be an afterlife (i.e., how our conscious selves could survive) after our physical brains die. One answer is that, even though our minds/selves depend entirely on our brains (and perhaps bodies), we can survive after our bodies die, because God reconstitutes our bodies in heaven (or more generally, because some power reconstitutes our bodies somewhere). Perhaps this sounds implausible. But it shouldn't to religious people. In fact, the way the Bible talks about life after death sounds more like this than like an afterlife of non-physical entities floating around (can something non-physical float?). Jesus is said to have risen bodily from the grave and ascended to heaven. If one wants these heavenly bodies to be indestructible, then God would have to either give them special (spiritual?) powers to avoid normal physical decay or rejuvinate them regularly. Again, there are no obvious problems with this view of the afterlife and several advantages over the view that we can survive after death only with non-physical minds.

All of this suggests that any conflicts between physicalism (or materialism) and theism (or religiosity) need not be about life after death but are more likely to be about the existence of God (or certain properties of God or of heaven) given a physicalist or naturalist worldview. On a naturalistic view, it is hard to make sense of where or how (a non-physical) God exists or where a heaven where God reconstitutes us exists or what explanatory work is being done by God or heaven (beyond alleviating our fear of death).

Finally, if we take the functionalist view that our mental states are essentially complex functional interactions, one might think we could survive the death of our brains if the functions (or "programs") of our brains could be adequately replicated in an artificial replica (e.g., a complex computer or a Matrix or something). Whether this would count as personal survival is an interesting question. On this view, perhaps heaven is a matrix!

The fact that one thing causes another does not mean than the second could not exist without the first. Consider the case of a forest fire, for example. A carelessly flung match could be the cause, and yet (a) the fire could continue even after the match is destroyed, and (b) other things, such as a bolt of lightning, could substitute for the match as cause of the fire. Similarly, one could think (a) that brain activity causes consciousness, but consciousness can continue even after the brain is destroyed, or (b) that things other than brain activity, e.g. cosmic vibrations, could also cause consciousness. Without evidence to support these possibilities, they remain mere possibilities; but they do show why the causal relation you cite does not "destroy an ideas of an afterlife".

If you think that an individual's consciousness is not just caused by the activity of her brain but is identical with it, then that consciousness must indeed cease when the activity of that brain ceases. But many who agree that there is an "obvious" causal relationship between consciousness and the brain do not think that consciousness is identical with the brain.

Read another response by Eddy Nahmias, Jennifer Church
Read another response about Biology, Consciousness, Religion