The captain claimed a policy that forbids deputies from having a relationship with a known felon violated his constitutional right to free association