The warden was filmed without his permission while on duty at Shotts maximum security prison in Lanarkshire.
His face was shown unobscured when the show, called Battle Scarred: Soldiers Behind Bars, aired on Channel 5 in April this year despite other prison workers having their faces blurred.
The officer, referred to only as Mr E, complained to broadcasting watchdog Ofcom that his privacy had been breached.
He said he deliberately did not tell people where he worked because of the dangerous criminals he dealt with and claimed the show had compromised his safety.
Ofcom upheld his complaint.
Channel 5 said Mr E's refusal was not communicated to them.
The Scottish Prison Service said they had tightened up their filming procedures as a result of the error.