DES MOINES, Iowa — A judge has denied the appeal for reinstatement of a former Polk County sheriff sergeant fired for insubordination and gender bias.

The Des Moines Register reports says Polk County District Judge Paul Scott ruled Friday that former Sgt. Dan Charleston failed to show that a county commission wrongly affirmed Sheriff Bill McCarthy’s decision to fire Charleston last year.

Fellow staff members accused Charleston of giving preferential treatment to male subordinates, harassment and gender bias, and he was fired June 23.

Lawyers for the former sergeant had argued that he was fired without just cause.

Charleston ran twice against McCarthy for Polk County sheriff and lost.

Charleston was also investigated last year for social media postings deriding Islam and calling the religion an “evil ideology,” but officials have said that was not a factor in his firing.

Information from: The Des Moines Register,