From Greek Mythology.com: Arachne in Greek mythology was a weaver who challenged Athena and was consequently transformed into a spider. There are three versions of the myth.
One version has it that she was a shepherd's daughter that was particularly skilled at weaving. Boasting about her skill, she infuriated Athena, who appeared and contested her. Athena weaved four scenes in which the gods punished those humans that considered themselves equal to gods and committed hubris; Arachne, on the other hand, weaved scenes in which gods abused humans. Arachne's work was clearly better than Athena's; the goddess, even more enraged due to what the weaving depicted, threw Hecate's potion onto Arachne, transforming her into a spider and condemning her to weave for eternity.
In a different version, at the challenge, Athena weaved the contest between herself and Poseidon over who the patron saint of Athens would be, while Arachne did a depiction of Zeus' advances to various mortal women. Athena realized how skilled Arachne was, but wanted to teach her to be more humble and respect the gods. Touching Arachne's forehead, the woman was filled with shame and hung herself. Athena brought her back to life and turned her into a spider, in order to let her weave all the time.
In the final version of the myth, Zeus was the judge in the contest between Arachne and Athena, and whoever lost would not be allowed to touch a spindle or the loom again. Athena won in this version, and Arachne was devastated that she could no longer weave. Out of pity, Athena transformed her into a spider, so she could continue weaving without having to break her oath.