Public officials sold the Sun “gossip” and “tittle-tattle” about Princes William and Harry during their time at Sandhurst, a court has heard.
An instructor at the military academy is alleged to have been paid nearly £24,000 by the newspaper for tip-offs.
Former Colour Sergeant John Hardy, his wife Claire and four senior Sun journalists have gone on trial at the Old Bailey over the allegations.
They all deny charges related to misconduct in public office.
The charges have been brought as part of Operation Elveden, the police investigation into alleged inappropriate payments from journalists to public officials.
Mr Hardy, a career soldier with the Scots Guard, is alleged to have given information to the Sun's former royal editor Duncan Larcombe on 34 occasions.
The 44-year-old, of Accrington, Lancashire, is said to have been paid more than £23,700 by the newspaper between 2006 and 2008.
His wife, 41, is accused of collecting some of the payments for her husband and channelling money through her bank account.
The Sun's former chief reporter John Kay, 71, of Golders Green, north London, is accused of paying Ministry of Defence official Bettina Jordan-Barber £100,000 for information over the eight-year period to 2012.
Former deputy editors Fergus Shanahan and Geoffrey Webster are alleged to have authorised the payments, sometimes in consultation with then-editor Rebekah Brooks, who was acquitted at an earlier trial of plotting to commit misconduct in a public office.
Prosecutor Michael Parroy QC said the press had been “greedy for stories”.
He said: “This trial is about greed. It is about public employees who were prepared, for money, to sell to the press stories which they had obtained in the course of their work.
“By this process they abused the trust placed in them by the public, you and I, to keep such private information private.
“As far as the press were concerned, they were prepared to buy this material because they were greedy for stories, front page exclusives and the like.”
He said the public interest in such stories was “often marginal or non-existent”.
Mr Parroy also told the jury: “The value placed on the information or material provided by these public officials, be they MoD official or soldier, was newsworthiness.
“Tittle-tattle and gossip about the royal princes, William and Harry, had a special value, as did titbits involving salacious or embarrassing conduct – 'splashes' as they called them – involving the revelation of such things as affairs between serving soldiers or their civilian counterparts; a 'love triangle'.”
The prosecutor said Mr Kay and Jordan-Barber had a “close and mutually beneficial” relationship, with the reporter, referring to her as his “number one military contact”.
Mrs Jordan-Barber held a senior position compiling news briefings for the MoD, and her husband was an instructor at Sandhurst at the time Prince William and Prince Harry were officer cadets.
She is alleged to have given Kay stories from Sandhurst about the royals, as well as information about army discipline and deaths in Afghanistan.
Mr Parroy said Mrs Jordan-Barber was motivated by money and had a “purely commercial” relationship with Kay.
Mr Kay, Mr Webster and Mr Shanahan, 59, of Felsted, Essex, are jointly charged with conspiracy to commit misconduct in a public office by plotting with Jordan-Barber.
Mr Webster, 55, of Goudhurst, Kent, is also facing a second charge of conspiracy to commit misconduct with a serving officer in the armed forces.
Mr Hardy is charged with misconduct in public office, while his wife is accused of aiding and abetting him in the offence.
Mr Larcombe, 39, of Aylesford, Kent, is charged with aiding, abetting, counselling and procuring Mr Hardy's offence.
The trial is expected to last for three months.