After working as a dental assistant for ten years, Melissa Nelson was fired for being too "irresistible" and a "threat" to her employer's marriage. "I think it is completely wrong," Nelson said. "I think it is sending a message that men can do whatever they want in the work force." On Friday, the all-male Iowa State Supreme Court ruled that James Knight, Nelson's boss, was within his legal rights when he fired her, affirming the decision of a lower court. "We do think the Iowa Supreme Court got it completely right," said Stuart Cochrane, an attorney for James Knight. "Our position has always been Mrs. Nelson was never terminated because of her gender, she was terminated because of concerns her behavior was not appropriate in the workplace. She's an attractive lady. Dr. Knight found her behavior and dress to be inappropriate." For Nelson, a 32-year-old married mother of two, the news of her firing and the rationale behind it came as a shock. "I was very surprised after working so many years side by side I didn't have any idea that that would have crossed his mind," she said. The two never had a sexual relationship or sought one, according to court documents, however in the final year and a half of Nelson's employment, Knight began to make comments about her clothing being too tight or distracting. "Dr. Knight acknowledges he once told Nelson that if she saw his pants bulging, she would know her clothing was too revealing," the justices wrote. Six months before Nelson was fired, she and her boss began exchanging text messages about work and personal matters, such as updates about each of their children's activities, the justices wrote. The messages were mostly mundane, but Nelson recalled one text she received from her boss asking "how often she experienced an orgasm." Nelson did not respond to the text and never indicated that she was uncomfortable with Knight's question, according to court documents. Soon after, Knight's wife, Jeanne, who also works at the practice, found out about the text messaging and ordered her husband to fire Nelson. The couple consulted with a senior pastor at their church and he agreed that Nelson should be terminated in order to protect their marriage, Cochrane said. On Jan. 4, 2010, Nelson was summoned to a meeting with Knight while a pastor was present. Knight then read from a prepared statement telling Nelson she was fired. "Dr. Knight felt like for the best interest of his marriage and the best interest of hers to end their employment relationship," Cochrane said. Knight acknowledged in court documents that Nelson was good at her job and she, in turn, said she was generally treated with respect. "I'm devastated. I really am," Nelson said. When Nelson's husband tried to reason with Knight, the dentist told him he "feared he would have an affair with her down the road if he did not fire her." Paige Fiedler, Nelson's attorney, said in a statement to ABC News affiliate KCRG that she was "appalled" by the ruling. "We are appalled by the Court's ruling and its failure to understand the nature of gender bias.," she wrote. "Although people act for a variety of reasons, it is very common for women to be targeted for discrimination because of their sexual attractiveness or supposed lack of sexual attractiveness. That is discrimination based on sex," Fiedler wrote. "Nearly every woman in Iowa understands this because we have experienced it for ourselves."