Ivans atheism stems from the fact that he cannot believe that a God would make children suffer, and even if God did exist he should be admonished and shunned because nobody, but a vile being would make children suffer.
Ivan comes up with a theory that states that since there is no God, and consequently no immorality, Evil-doing must not only be lawful, but even recognized as being the most necessary and most intelligent way out of the situation that ever atheist finds himself Basically it means, without immorality there can be no virtue.
However, Ivan is a very moral person, as can be seen with his example about how could God exist if he makes children suffers. He sees his theory played out to its logical extreme in his father, and Ivan is disgusted by it. He doesnt admonish his father; he only tries to reel him in when he goes to far. He doesnt stop him because if he did, he would be going against his theory, and Ivan cannot go against his theory because he only believes in logic and reason. Ivan cannot escape the logic of his idea, and suffers terribly for it.
Ivan does seem to want a new idea, wants something to replace the horrible idea that he believes in now. I believe that this can first be seen when he convinces his family to go see Father Zosima. Ivan asks how his idea can be resolved. How it can be resolved in a positive direction. However, he doesnt accept Father Zosima and Aloyshas view of the world just yet because he still cannot accept that a benevolent God would make children Suffer.
Ivans idea is more fully expressed in The Grand Inquisitor. He basically states that the problem with God was that he gave mankind free will. If God succumbed to the 3 temptations of the Devil mankind would be infinitely happier, and there would be no suffering. He wants a small group of people, who will suffer for knowing the truth, care for every person of the world. Give the people their basic needs, and make sure that everyone is content and no one suffers. Most importantly, force them into believing that there is a God. Basically Ivan wants to take away peoples free will and have a few people give the people everything that they would need to live a comfortable life.
Ivan does not understand, unlike Father Zosima and Aloysha, that faith would mean nothing if it was forced on you. If it was forced on you by God, or anyone else, your soul would not go to heaven; it would not be saved, because you did not choose to follow God. Choice is everything. If there was no choice, nothing would matter. This can be seen when Father Zosima dies and the stench of death reeks up the place. A lot of the monks and people who disagreed with him, or just like to see a good man be brought down, that this is a sign from God that Father Zosima was wrong, wasnt a saint, wasnt a good man, and did receive Gods graces. At first, Aloysha has doubts about this, and cries because of it, but once he visits Grushenka his faith is restored. He realizes that faith is everything, and that supposed signs mean nothing. If people need signs from God or evidence from God, then faith in God would mean nothing. Aloysha realizes that and gets his faith back.
Ivans dealing with Smerdyakov greatly shook his idea. After the murder of their father by Smerydakov, Smerdyakov tells Ivan that he got the idea of killing their father from Ivan. Smerdyakov thought, if Ivan says everything is lawful, and Smerdyakov greatly respected Ivan, then it must be true. So, for personal gain and interest, Smerdyakov killed his father for money to help him start a new life, and probably for revenge as well. His plan was also predicated on Ivans cooperation, and a lot of other circumstances to happen. Smerdyakov needed and basically asked Ivan to go away, and Ivan did. Did Ivan know that he was going to murder their father when he went away? Possibly, but it doesnt really matter if he did or not because it only strengthens a point and does not make it.
The point is shared guilt. Before Ivan thought that his sins were his alone, and he was only responsible for himself. He did not agree with Father Zosima and Aloysha that anybodys actions are predicated on a bunch of other people and circumstances. Consequently, man should not judge other men because no one is free of guilt because their actions could, even if they dont see it, affect or induce or contribute to someone elses sins.
Ivan starts to realize this, that his actions contributed to the death of his Father, and that he is also responsible for his death. However, Ivan does not yet accept this, because he is still clinging to his logical idea. Consequently he becomes delusional. This is best represented by Ivans discussion with the Imaginary devil.
Basically, from what I remember, the devil is mocking Ivan and his ideas, and is trying to force Ivan to recognize that he exists. I believe that means that if Ivan recognizes that his imaginary devil exists then he would be admitting that illogical and irrational things exist, and admitting that he has faith in existence of the devil. If Ivan has faith that the devil exists wouldnt it be logical that God exists as well? In Ivans former mind, faith does not exist, only logic, so he cannot say that the Devil exists, based on faith, while God does not exist. That just wouldnt make any sense.
Ivans delusional state culminates when Ivan takes the stand in Dmitrys trial. Ivan testifies that Smerdyakov killed their father, and that he is also responsible for their fathers death. He admitted that his actions resulted in the death of their father so he should be judged as well. From this, it seems, even though Ivan is in a delusional state, that he has accepted or is beginning to accept Father Zosimas and Aloyshas view on things. It seems like he is accepting their worldview because he is accepting the concept of shared guilt.
Does that mean that Ivan has also accepted God, and turned to the teachings of Father Zosima? I think that is open to interpretation because right after he testified, Ivan goes into coma, or something like that, and doesnt awake. However, it seems to me that he has already accepted Father Zosimas teachings or will eventually accept Father Zosimas teaching after he regains his health. I dont think Dostoevksy, who believed that suffering was an important part of redemption, meant for Ivan to be interpreted as someone who dies from his illness and never gets saved.
Basically, Dostoevsky agrees with Father Zosima and Alyoshas worldview of faith, love, and acceptance, and shows the problems and mistakes of Ivan worldview. The worldview of logic, skepticism, and doubt.