It also implies through the actions of Dmitri and Ivan that there are at least two possible routes to take if there is no immortality and thus no morality. One can, like Dmitri, follow one's libido and pursue that which seems to feed the passion of the moment. In Dmitri's case, this is the pursuit of Grushenka. Or, like Ivan, who seems to be a nihilist, one can entertain oneself by manipulating others beliefs and ideas through playing devil's advocate. Ivan publishes articles supporting ideas that he, himself, doesn't believe in. At times it appears that ideas are as meaningless or contradictory to Ivan as life is. It must be noted that both of these characters are unhappy. Dostoevsky painted both Ivan and Dmitri as tormented and miserable. If happiness is the measure of a good life, neither is living it. There is one other character who speaks to this idea, Rakitin. He says that man will pursue virtue without immortality because he values liberty, equality and brotherhood. This is ironic because Rakitin, who unlike Ivan is sincere, is a spiteful and vicious character who feels nothing but envy for what others have.
That's a good answer, but the statement made in the novel also implies a corollary. If there is no afterlife, does this mean that there is no reason at all to have personal morality in the way we treat one another? Or is there a value in this life to behavior which relates to the good of others? This is an issue we find repeatedly implied in this author's works.
What the character is saying is that if human life ends at death, and there is no afterlife, then there is no reason for having moral standards. This idea also addressed in several of Nietzsche's books including "The Will to Power". One theme in "The Brothers Karamazov" considers human behavior and purpose. The characters of faith behave in a certain way because they believe they will be judged by God for their choices and behavior. Others do not believe in an afterlife. Because of this, there is no reason to behave in any certain way.