Her Majesty was "irritated" after officers continually scoffed the snacks, according to an email sent by Clive Goodman, former royal editor at the now-defunct News of the World (NotW) tabloid.
London's Old Bailey heard how a memo was sent to palace officers telling them to "keep their sticky fingers out".
The email, addressed to former NotW editor Andy Coulson, read: "Problem is that police on patrol eat the lot… memo now gone around to all palace cops telling them to keep their sticky fingers out."
Prosecutor Andrew Edis QC told the jury that the Queen was "upset" at the behaviour of the officers charged with protecting her, her family and her home.
Brooks also faces two counts of conspiring with others to commit misconduct in public office - one between January 1 2004 and January 31 2012, and the other between February 9 2006 and October 16 2008 - linked to alleged inappropriate payments to public officials.
She also faces two allegations of conspiracy to pervert the course of justice - one with her former personal assistant Cheryl Carter, 49, of Chelmsford, Essex, between July 6 and 9 2011, and a second with her husband, Charles Brooks, and former News International head of security Mark Hanna and others between July 15 and July 19 2011.
All the defendants deny the charges.
The trial continues.