Mark Hingston from Kettering admitted lying to his then-wife about the extra £20,000 taken out as part of a joint mortgage application, which he used to fund his habit.
In total Hingston ran up a £52,000 debt hidden from his wife, the Northamptonshire Telegraph reported.
After admitting two counts of fraud by false representation and one of theft, Hingston was spared jail by Her Honour Judge Adrienne Lucking QC at Northampton Crown Court on 4 January.
In sentencing, Judge Lucking was sympathetic to his attempts to tackle his addiction, which included installing an app on his phone to block gambling, requesting bookmakers to ban him and paying off his debts.
A condition of the community order was to attend a rehabilitation programme.
Lied to wife
The court heard how after completing the joint mortgage application Hingston told his wife that an additional £20,000 had been incorrectly taken by conveyancers.
However, Hingston had taken out a further £20,000 loan to cover his debts which he persuaded his wife not to use to pay off the mortgage.
Eventually in 2015 Mrs Hingston discovered a further £900 debt racked up on her credit card and £5,000 loan in her name granted from a forged signature and that all loan correspondence had been directed to his work address.
The pair have separated as a result.