Interesting point. Lots of case law in the area of how far a public employer can set standards of conduct. Clearly, most governmental offices have standards which permit discipline up to termination if an employee acts in such a way as to bring discredit on the office. Generally it has to link directly to the job and employee. 50 years ago, living outside of marriage, or pregnancy outside of marriage might qualify. I doubt if many people today would give it a second thought.
Then there's the issue of whether the "standard" is necessary for the successful execution of duties. Pretty doubtful that a moral issue like that has any bearing on her job. For example, you couldn't fire someone for getting pregnant, married or not.
Finally, there might be an out for the sheriff, if she violated a contractual agreement, but again, a judge might find it was not material to her execution of duties, and likely would be unenforceable.
Two problems. 1st, North Carolina an at-will employment state, (You can be fired at any time, for any reason). The only time an employment contract in NC is NOT at-will is if the employeer makes a specific contract to limit his reasons for fireing the employee.
Secondly, Employees of the Sheriff in NC can be fired at any time for any reason because they serve at his pleasure. He doesn't need a reason to fire the woman. He basically can say, "Hey, you've done a good job for me, but it's time for you to go. Goodbye".
The woman doesn't have a case, she can't force the sheriff to let her work for him.