In my opinion this is why he attacks Sonia’s faith. Sonia doesn’t have answers to all her life questions, but she does have answers to the important question of eternity. She knows what is right and wrong. This bothers Rasknolnikov, because if Sonia and her God are right, he is a terrible sinner.
He doesn't want to believe this. He doesn't want to believe that he is wrong in a sinful way. He does not see the murder as wrong. The murder bothers him, but his worldview won't let him admit that he was wrong.
Ultimately if Sonia's faith is correct than he would have to turn himself in.