Medusa, in some iterations of the myth, is portrayed as a seductress. She knew how beautiful she was and used her beauty to her advantage. Medusa would seduce Poseidon and have a sexual encounter with him in the temple of Athena, a virgin goddess. When Athena found out about this encounter, she turned Medusa into a gorgon to punish her for her pride and the sins she committed against the goddess.  In this version of the story, Medusa's actions are referred to as sin. One can argue that sin is a conscious transgression against a deity. Once an individual has sinned, this then prompts the offended deity to take action against said person, usually in the form of judgment. Since sin is considered evil, Medusa would thus fall under the category of evil. To further speak to this idea, another version of the Medusa myth elaborates on Medusa's sin in depth. This iteration sees Medusa admiring herself in the mirror, which is then followed by a remark stating that she was more beautiful than Athena.  In the previous story, one may have made the case that committing sexual acts was not a justifiable reason to punish Medusa. This telling of the myth, however, makes explicit what Medusa's transgression against Athena was. In Greek mythology, comparing oneself to the gods often begets dire consequences. When Medusa compared herself to Athena and proclaimed herself prettier, she attempted trespassing into the realm of the gods, effectively making herself a target of Athena's judgment.
On the other hand, Medusa may have been punished by Athena for another reason. It may not have been the result of Medusa's vanity, but because of Athena's jealousy of Medusa's beauty.  One of the common threads in most iterations of the Medusa myth is that Athena was jealous of Medusa. Finding Medusa in a relationship with Poseidon arguably gave Athena an excuse to punish her, enabling the goddess to act based on her predispositions. If Athena did not feel jealous of Medusa, it is possible that Athena would not have been so enraged at Medusa. Not having that impulse would likely have resulted in a different punishment, or even resulted in Athena directing her fury at Poseidon instead.