Shohab Jalil, 35, was mistakenly given over half a million pounds by a computing error made by Preston City Council.
When questioned by police about the £686k that had been put into Mr Jalils account he told them he thought that God had gifted him a reward for all his charity work.
Police Visited Mr Jalil at his home the day after the money was transferred into his account.
He told police he had “been a bit naughty with it” and had already spent £36,000 and given away £23,000 to his friend Barkat Ali Yousaf, 36, who was heavily in debt and needed the money.
Mr Jalil maintained that he had no intention of keeping the money but giving it back at a later date.
Prosecutor Rachel Cooper, said: “On January 11 staff at Preston City Council became aware a payment had been credited for £626,257.
“It was enacted on January 8 but took several days to be processed through system.
“It was later proved it was a simple computing error but money went into Jalil’s account and the council was not able to get it back.
”Police got in touch with Mr Jalil at 10.50pm that night. They asked if he had noted the large amount of money in his account.
“He replied: ‘Yeah, I’ve been a bit naughty with it.
“He told officers he thought it was a reward from God for the volunteering he’d done.”
Defense lawyer, Geoff Whelan, said: ‘By complete mistake the money was paid into his account.’
‘He had bought a bicycle for his child but the vast majority was spent on clearing debts.’
Jalil was given a six-month prison sentence, suspended for 18 months after admitting two counts of theft while his friend Yousaf, from Bideford, Devon, received four months, suspended for 18 months after he admitted concealing criminal cash.
Judge Christoper Cornwall branded Jalil’s actions “pretty discreditable” as he sentenced Jalil and Yousaf.
The judge said: “By reason of a computer error, £626,000 of public money which was intended to go to a legitimate recipient went by mistake into your account. And you then misappropriated some of that money.
“There was around £17,260 never recovered. Of that £13,762 is attributable to Jalil and £3,500 to Yousaf.”