It is narrated from Sayyiduna Abdullah bin Amr (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "There are three men: whichever of them takes a loan, then dies and cannot repay it, Allah, the Mighty and Majestic, will repay it: a man who is in the path of Allah and his strength weakens, so he gains strength against his enemy by taking a loan, then dies and cannot repay it; a second man with whom one of you dies, and he finds nothing to shroud him and bury him with except by taking a loan, then he dies and cannot repay it; and a third man who fears tribulation for himself in remaining unmarried, so he takes a loan to marry and thereby keeps himself chaste, then dies and cannot repay it. Indeed, Allah, the Mighty and Majestic, will repay on their behalf on the Day of Resurrection."
Hadith Referenceالمعجم الكبير للطبراني / باب العين / 13772