I don't think your understanding about why religions exist and how they deal with the existence of suffering is as universal as you think it is. I also don't think it's accurate to call statements like "there is an afterlife" a lie, even from an atheist point of view. A lie is a deliberate falsehood, and religions (with some possible exceptions) are not built around deliberate falsehoods.
Re: Religion as a mental virus