The retired gardener stood in the dock and listened as Judge Claire Ryan described his offending as "repugnant''.
She said family members of one of the dead boys had been contacted by police and had described Diedrichs' offending as "horrible and distressing''.
The court heard how Diedrichs took the details of a two year-old boy who had died in 1935. He later used similar details of a boy who died in 1957.
He used the details to get birth certificates and passports in both the boys' names and then applied for superannuation benefits.
All the while, Diedrichs was also receiving superannuation payments in his own name as well.
Diedrichs was caught when the Department of Internal Affairs used facial recognition software and found that Diedrichs' face was on more than one passport. That information was then passed to police.
Social Development Ministry lawyer Christopher Howard told the court that the offending was "devastating'' to the families of the dead boys.
He said Diedrichs was motivated by greed.
In a report from probation, read to the court, Diedrichs said: "I had money but not enough. I was being greedy. I never thought I would get caught, looking at my age.''
Diedrichs' lawyer Lincoln Burns said his client had not lived an "indulgent'' life and much of the money was recovered.
He said Diedrichs was sorry for what he had done, had pleaded guilty at the earliest opportunity, had no previous convictions and should be given a sentence of home detention.
But that did not wash with Judge Ryan.
She said if Diedrichs had not been caught, he would have continued to take extra super payments.
"There was a high degree of planning, premeditation and complexity.''
Detective Stephen Peat of the police Assets Recovery Unit told APNZ that $357,000 was seized from Diedrichs in the High Court at Auckland under the proceeds of crime legislation.
He said Diedrichs had hidden the money in 29 different bank accounts and used several different banks.
Mr Peat said the bulk of the money was in Diedrichs' name but he also had accounts in the names of the dead children.
The Social Development Ministry's head of fraud Mike Smith said Diedrichs' deceit was selfish and he had shown a ``callous disregard toward taxpayers, to genuine beneficiaries, and most of all to the families of the babies whose identities he stole.''
He said the Ministry would continue to pursue the missing money and would look at seizing assets and taking money from future superannuation payments.
"Diedrichs went to extreme lengths to carry out this offence. It's a type of offending that simply cannot happen today,'' said Mr Smith.
Mr Smith said controls are much stronger now than 20 years ago and all new benefit applications are matched against the births and deaths register.
These systems include a comprehensive data mining and data matching programme which checks 538 million records each year, he said.