Medusa made a vow to the virgin goddess Athena, that as long as she served the goddess, so too would Medusa remain a virgin. When Medusa willingly entered into an affair with Poseidon, the god of the sea, she broke that vow to Athena.  Making a vow or a promise to someone in Greek mythology is binding, especially if the vow is to one of the gods. Medusa's choice to break her vow to Athena offended the goddess. In light of Medusa's relationship with Poseidon being a choice, it is also just as likely that everything they did together was mutual. In other words, Medusa did not do anything she didn't feel compelled to do. Their affair became much more offensive to the goddess when they decided to have their affair in Athena's temple.  As a result, Athena lashed out at Medusa's disrespect and turned her into a gorgon.
One can make the case, however, that Medusa did not enter into her relationship with Poseidon willingly. Another version of the story suggests that Poseidon used Medusa to humiliate Athena. To do this, the sea god violated Medusa in Athena's temple. This telling of the myth also does well to note that Medusa reached out to Athena, both for guidance and forgiveness.  What this version shows is that Medusa did not willingly break her vow to Athena, which only further attests to the idea that her relationship with Poseidon was not consensual.