It was her actions and admittedly the reactions of the employer that caused the problem.
What actions of hers?
At one point, Knight told Nelson that "if she saw his pants bulging, she would know her clothing was too revealing," the decision read.
We can condemn his actions (and his wife certainly did), but she was clearly a participant in mutual flirtation. Sometimes, it's not about looks specifically, but that two people "click". They catch the innuendos from the other, think similar (dirty) thoughts, and feed off each other in this way. It's a fun game initially, but over time this will tend to grow into something beyond just flirtatious comments if the breaks aren't put on at some point. And that usually requires not interacting with the other person so frequently. So while it seems unfair, when this happens between an employer and employee, termination may have been the only way to end this process.
Sucks and all that, but it's one of the reasons why you should maintain a professional demeanor at work. She clearly went well past "attractive employee being hit on by her boss", and became a participant herself. At that point, she lost any high ground she might have had. It's an unprofessional work relationship, and the boss can't fire himself.