The overriding religious theme in Robinson Crusoe is that of redemption after acceptance of God. In the first chapter, Crusoe recounts a storm that nearly sunk his ship:
I expected every wave would have swallowed us up... in this agony of mind, I made many vows and resolutions that if it would please God to spare my life in this one voyage... [I would] never set it into a ship again while I lived.
However, following his survival of that storm, he is dismissive of this early repentance:
I found, indeed, some intervals of reflection... but I shook them off, and roused myself from them as it were from a distemper, and appl[ied] myself to drinking and company.
He is soon caught in another storm:
...I was stupid, lying still in my cabin, which was in the steerage, and cannot describe my temper: I could ill resume the first penitence which I had so apparently trampled upon and hardened myself against.
This time the ship sinks, but he survives, only to be shipwrecked and cast away on a tropical island. Now, Crusoe's refusal to repent the second time could have been the direct spiritual cause -- it certainly helped with his obstinate nature, as he admits that if he had just returned home, everything would have been fine. After the final shipwreck, Crusoe finds that he is able to eke out a reasonable living on the island, and thinks little of religion until he is beset by a terrible sickness:
JUNE 21. - Very ill; frighted almost to death with the apprehensions of my sad condition - to be sick, and no help. Prayed to God, for the first time since the storm off Hull, but scarce knew what I said, or why, my thoughts being all confused.
Prayed to God again, but was light-headed; and when I was not, I was so ignorant that I knew not what to say; only I lay and cried, "Lord, look upon me! Lord, pity me! Lord, have mercy upon me!"
In this second sleep I had this terrible dream... I heard a voice so terrible that it is impossible to express the terror of it. All that I can say I understood was this: "Seeing all these things have not brought thee to repentance, now thou shalt die."
(All Quotes: Defoe, Robinson Crusoe, eNotes eText)
Crusoe understands his plight to be of his own making; he refused to accept God in his life, and so was punished, and yet given the opportunity again and again to repent. Finally, after a shipwreck that left him on an island with food and fresh water -- an amazing stroke of luck -- he still does not repent until his fever dream, when he understands that every stroke of luck was in fact divine providence. Crusoe becomes devout and is able to survive and eventually return to civilization.