Following CCTV footage of the thefts, police were led to Lovett, who told them he had already sold the petrol for $1 a litre.
Police searched the house in High St, Masterton, where five children were living, and "followed the smell of cannabis to a locked room", Judge Barry said.
Mr Kitto, a boarder at the house, had produced a key, and police opened it to discover 13 plants about a metre high, which had "produced seed heads and flower heads".
Police had estimated a yield of between 26oz and 104oz, with a value of $9000 to $36,000, but Judge Barry noted the estimations were "more an art than a science".
The electricity supply had been diverted to the growing room, where there were growing lights, set timers, ducting, fan systems, along with a watering system and nutrients.
Mr Kitto's lawyer, Steve Taylor, said Kitto had become a drug addict after taking up cannabis smoking in his 30s.
At the time he had a "successful business cultivating seaweed with his wife", but his addiction had cost him the business and his marriage.
Mr Taylor said Kitto had been drug free on remand and wanted to remain so. Judge Barry said Kitto's offending was aggravated by the fact he had only been released from one of many prison sentences for drug offences in March, "and this set-up had mature plants by September".
The judge sentenced him to two years prison, followed by an alcohol and drug programme.
Lovett's lawyer, James Elliot, said Lovett had a "severe methamphetamine addiction", which had driven his offending.
Mr Elliot said Lovett was concerned for the future of his children, whom CYF had removed from the house after the drug find.
He had since "re-established his family with new accommodation" and the children had been returned.
Judge Barry said the cannabis growing was premeditated and clinical.
"There was no evidence of cannabis sales, but of course it was nipped in the bud, as it were."
The petrol thefts had "resulted in significant losses for smalltown retailers".
Judge Barry said in Lovett's case "rehabilitation trumps deterrence", and he sentenced him to eight months home detention and 130 hours community work.
The judge also ordered Lovett to pay $887 to the electricity company, being half the amount of stolen electricity, and a total of $3000 to the three petrol stations, being half of the losses incurred.
Another person has been charged as a co-defendant in the petrol thefts and has pleaded not guilty.