History suggests that Socrates was found guilty of corrupting the young of Athens and put to death by ingesting poison because he did not worship the city's gods. After being found guilty, he could have either accepted the death penalty or gone into exile. But he choose to stay in Athens and take his sentence quietly.
The choice might have been motivated by a variety of factors, all of which are within Socrates' control. One possible explanation is that he valued his values and convictions more than his own life. It is possible that Socrates valued his integrity to his ideals of truth and justice more than his own life.
There is also the possibility that Socrates saw his punishment as a chance to preach the virtues of his philosophy and the strength of his ideas. He may have sought to encourage people to think for themselves and seek justice and fairness by accepting his death sentence with grace and courage.
It should be noted that various historians have provided varying interpretations of the grounds behind Socrates' choice. These are, however, just a handful of the theories that have been proposed by experts.