The pre-sentence report suggested a non-custodial punishment for Pawanpreet Johal who was of previous good character before committing a burglary and a theft, Wolverhampton Crown Court heard.
He stole £4,000 worth of jewellery from a house in Cooper Road, Walsall on July 18 and nine days later stole the handbag of a volunteer worker from the Sikh temple in West Bromwich High Street.
The family whose home was burgled by him said the offence had left them so scared and upset that they now slept downstairs, explained Mr Andrew Wilkins, prosecuting.
Johal struck at the Sikh temple after the victim left her handbag by the door.
He dried his hands in the kitchen and then used the towel to hide the bag.
He turned to crime after getting hooked on heroin and was jilted by his wife leaving homeless and reliant on food and shelter from the temple until he lost their support by stealing the handbag, the court was told.
Mr Graeme Logan, defending, continued: “While the suggestion of a non-custodial sentence is helpful he fears it will set him up to fail.
"He is being helped off drugs in prison where he has been held on remand since arrest.
"He says his body has recovered from drugs but his mind has not yet, so if released he could be quite easily be tempted.”
Recorder Jennifer Jones told Johal, of no fixed address, who admitted both offences: “Given what I have heard about your personal circumstances, I believe immediate custody is the right sentence.”