And now this world shall know Pain...
To understand why his reasoning is the way it is and what influenced his mind and his actions, we need to know his backstory.
Pain was not always known as Pain but as Nagato. Nagato was born in the village hidden in the rain during the second shinobi war as a child. Madara Uchiha implanted the Rinnegan into Nagato's eyes. The Rinnegan abilities only emerged out of self-defense after his parents were murdered in front of his eyes by two Konoha shinobi. The timid Nagato was forced to leave his home in search for food and shelter. Nagato ended up making friends and grew up alongside them as Yahiko and Conan became his best friends and his family. The trio were eager to learn ninjutsu but also to find food it was later on they came across the three signing of the leaf where Jiraiya would engage them. After Jiraiya discovered Nagato and his powerful eyes, he decided to train the three ninjutsu seeing the potential of Nagato as the sage of six paths or the possible reincarnation.
The three later went on to form the Akatsuki with a goal to bring peace and end war. They amassed many members and followers. As the rain was a land of suffering, every single ninja war used the rains location which was in the middle of the Land of Fire as a battleground. Countless people and land were constantly being ravaged. The Akatsuki's goal generated hope for these individuals but this success would not last very long as they were now in the third shinobi war.
Hanzo of the salamander was no longer interested in peace but now preserving his power and so alongside danzo's anbu, he ambushed the three friends threatening to kill Conan if Nagato will not kill Yahiko. Yahiko ended up taking his own life at the hands of Nagato's kunai encouraging the Rinnegan user to change the world as he wanted to. This enraged Nagato as he retrieved Conan from their clutches but he was immobilized in the process through the death of his best friend and a realization of the world. Nagato's philosophy was born and thus the six paths of pain were also born using Yahiko's body and the bodies of Jiraiya's former enemies.
Paine believed that a cheating peace through friendship and uniting individuals was a naive and brash way of looking at achieving peace imprudent even. Paine believed the world was in a never-ending cycle of hatred and death and that the only way to achieve true peace was through the experience of war. Essentially by knowing pain by virtue of this, he set out a new plan. Pain with the help of the new members of the Akatsuki which would be comprised of the strongest rogue shinobi from the hidden villages, he would assemble them and send them off to different villages in order to pursue every single jinchuriki. He was after the tailed beasts. His plan was to capture every single tailed beast and release time upon every village and wants every village to felt destruction and loss. Once every person has felt pain, they would cease to fight each other thus creating peace.
Pain's philosophy is possible through understanding. Once everyone has felt the same pain, they would not want to experience it again. They would all understand what pain feels like which breeds peace. Pain was utilitarianism, a theory created by the philosopher Jeremy Bentham, that focuses on results rather than rules. Pain's methods were for the greater good, the lives that were lost was for the greater good because more people would end up surviving as a result of pain.
Pain wouldn't have minimized the pain but he would have maximized pleasure of the highest quality that being survival achieving the greatest good for the greatest number of people.