According to Tsunade, Orochimaru had always been twisted, even back when he was a child. His sadistic attitude was presumably due to the death of his parents, which led him to study kinjutsu and eventually becoming obsessed with learning all ninjutsu. Jiraiya theorized that Orochimaru went down this path in an attempt to forget his painful memories. Sarutobi in particular had very high hopes for Orochimaru, often berating the clumsy Jiraiya and telling him he should be more like his team-mate. After becoming the Third Hokage, Sarutobi hoped that one day Orochimaru would succeed him. He eventually became Anko Mitarashi's mentor, teaching her ninjutsu and taking her, along with nine others, as a subject for the Cursed Seal of Heaven.
Over the years, he had been kidnapping his fellow Konoha shinobi and used them as human guinea pigs. He experimented on them to develop techniques that would grant him immortality, as he had already decided that he would settle for no less than to learn all jutsu in the world (a task that would take much more than one human lifetime). When the many disappearances were finally traced to Orochimaru, Hiruzen knew that it was his duty to kill him. At the time however, Hiruzen was unable to bring himself to kill his prized student for whom he had such high hopes. Before Orochimaru defected, he kidnapped sixty children and injected them with the First Hokage's DNA, hoping to recreate the First's Wood Release jutsu. Before he could finish his work he was forced to leave Konoha, but he believed all the test subjects to be dead. Yamato was the only survivor of the experiments, and had gained the use of the wood element. Orochimaru conducted similar experiments on Danzō, endowing the elder with the Wood Release and multiple Sharingan.
Orochimaru defected from the village and joined the elite criminal organization of Akatsuki. His former teammate, Jiraiya, tried to convince him to reconsider, but to no avail.