A gang dubbed the Notorious Nine were released from HMP Bullwood Hall at Hockley after spending a day behind bars.
Essex Police deputy chief constable Charles "the Enforcer" Clark had been sentenced to prison, along with Bishop of Chelmsford John Gladwin, for "extortion".
Police surgeon Alec "the Knife" Mitchell also did bird with current and former Essex High Sheriffs Mark "the Reaper" Thomasin-Forster and Andrew "the Sabre" Streeter.
Judge Zoe Smith found the gang responsible for "taking money from the public for charitable causes" and locked them up for the whole day.
While doing porridge, they wore prison uniforms, ate prison food and carried out prison work such as making boxer shorts to raise cash for the Essex Community Foundation.
Basildon Crown Court Judge Philip Clegg, aka "Judge Dredd", said: "We had a real gang inside. We had to raise £1,000 each or we wouldn't be let out and we have managed to raise £9,000.
"There is a serious side, though - we are raising cash for charities that work with young people and help steer them away from offending.
"It has been a real learning experience for our gang. The regime here is very caring and supportive but nevertheless it made us think when we were able to walk out of here and these ladies were not."
The Essex Community Foundation's latest scheme will help charities working with vulnerable adults and young people.
The foundation has raised £4m for 1,500 groups since it was set up in 1996.
In the past it has raised money for Youth At Risk in Basildon, Southend Football and Community Scheme and Basildon Motor Project.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules hereComments are closed on this article