Gurmej Singh, 40, has admitted trying to engage in sexual communication with a child and attempting to arrange the commissioning of sexual activity with the child.
It happened in Telford in July 2018.
Singh's representative James Elvidge told Shrewsbury Crown Court this week that he had been in the UK for 15 years but that his status as an asylum-seeker meant he was unable to work and had lived "on the breadline" throughout that time.
"It seems very much to be a one-off situation... an aberration," he said.
"His personal circumstances are extremely difficult.
"He realises what a fool he has made of himself. It has embarrassed him with his family, with the local community."
Judge Anthony Lowe challenged the assessment of an "aberration", pointing out that Singh contacted the person he thought to be a girl over several days.
'No actual victim'
Judge Lowe said: "There has been no previous sexual offending and most importantly of all, there was no actual victim.
"Having said that, you did not know that the person you were talking to, that the person you intended to meet, and the person you hoped to have sexual activity with, did not exist.
"Whatever your circumstances, whatever depression you may have does not in any way explain why you were looking for somebody so young."
He said that Singh deserved nine months in jail, reduced to six for his early guilty plea, but that suspending it would reduce the risk of him offending again.
"If I impose an immediate custodial sentence of six months you will be released in 12 weeks and although you would still be on license, within six months that sentence would be over," he added.
"I think I have, the court has, better control over your future behaviour by suspending your sentence for two years."
Singh, of Turnberry Road, Great Barr, Birmingham, will have to complete 30 rehabilitation activity days and 120 hours of unpaid work.
He will also be subject to a curfew between 9pm and 6am for three months.
The judge said that the justice system does not have sufficient resources for a Punjabi interpreter to attend group therapy sessions with Singh.