He also hacked Prince William 35 times and Prince Harry on nine occasions.
This is the first time the jury has heard of a royal's phone being hacked. Mr Goodman, who denies conspiring to commit misconduct in public office, previously said he only hacked aides.
Mr Goodman is one of seven defendants, including ex-News of the World editors Andy Coulson and Rebekah Brooks, on trial at the Old Bailey. They all deny the charges against them.
He returned to the trial to resume giving evidence after a long period away due to illness.
The court heard how Mr Goodman hacked Ms Middleton on Christmas Eve, Christmas Day and Boxing Day in 2005 - more than five years before she married Prince William.
He also hacked her on 7 August 2006, the day before he was arrested over allegations of phone hacking.
Prince William's voicemail was first intercepted in late January 2006, the court heard.
This was the first time that the jury has heard that a mobile belonging to Prince William was hacked.
'Semi-royal status' Mr Goodman, 56, denied he had "forgotten" about targeting the young royals when he said in evidence earlier in the trial that he had only hacked aides working for the royals.
The jury was also told that Mr Goodman hacked Michael Fawcett, a trusted aide of Prince Charles, 35 times.
Upon his return to the witness box, he was accused of being more heavily involved in phone hacking than was previously heard.
Mr Goodman and private detective Glenn Mulcaire were convicted in 2006 of intercepting voicemails of royal aides. But jurors were told their activities went much further.
Under cross-examination by Mr Coulson's lawyer Timothy Langdale QC asked him why Ms Middleton had been targeted.
"She was a figure of increasing importance around the Royal Family," Mr Goodman said.
"There were discussions about her and Prince William marrying, moving in, settling down. She started to receive semi-royal status and things were moving on."
'Open and honest' The witness said he had been assured by the Crown Prosecution Service he would face no more hacking charges.
He told the court he was "not on trial for hacking" when he was presented with a list of victims, saying: "There has been no intention to deceive you or anybody else in relation to phone hacking."
He said he had been as "open and honest" about hacking as possible and that no-one had asked him questions about hacking royals.
Mr Langdale said: "You knew perfectly well you hacked Prince Harry and Prince William didn't you?"
The defendant replied: "Nobody asked me."
The former royal editor had not been in court since the end of March after he was declared unfit to carry on. The trial continued in his absence.
The judge told the jury that Mr Goodman had been "ill", but the court was given a report from an independent medical expert declaring him "now fit" to continue.
Mr Justice Saunders also told the jury that he had "no alternative" but to keep them waiting because medical assessments were continually being submitted.
Mr Goodman will be allowed more time than usual to give the remainder of his evidence because medical experts have advised he may get tired more quickly.
The jury previously heard that the former royal editor of the now-defunct tabloid had undergone a minor heart procedure during the trial.
'Wider scale hacking' Appearing on Wednesday in the witness box, with a small bandage over his left hand, he was asked what he knew about phone hacking before January 2005, when he said he had been told about it by a colleague.
Before then, the News of the World colleague had passed pieces of information to Mr Goodman for stories. But the defendant said he never knew where it came from.
Mr Langdale asked Mr Goodman what he had known about Mulcaire. He replied that the private detective was known at the newspaper as someone who "provided results to a story that could not be cracked". But he denied he had put two and two together.
Mr Langdale said: "I'm going to suggest to you, you knew a great deal about phone hacking much earlier than you have told us."
The defendant said he could not recall at this distance.
Mr Langdale added: "I'm going to suggest you had direct contact with Glenn Mulcaire significantly before the time you have told us - that you yourself had been hacking on a much wider scale than you have told this court about."
Later, Mr Goodman told the court just how "valuable" Mulcaire had been to the paper.
"Like him or hate him - and people can make their own judgements about what we did - he was a valuable resource for the paper," he said.
"Virtually every story on the paper ground through the Glenn Mulcaire mill."