"In 399, the 'climate of opinion' was no doubt unfavorable to him. Most of the young aristocrats who had flocked round him were dead or discredited, and the leaders of the restored democracy were middle-class 'no-nonsense', rather anti-intellectual business men. They would approve when Meletos (probably a religious bigot, not the same Meletos who arraigned Andokides) undertook a prosecution calculated to force Socrates out of Athens." The Pelican History of Greece, Pg. 306
I admittedly flipped to the index and skimmed until I found that quote, but as I understand it Socrates was executed as a counterrevolutionary by the restored Athenian democracy. (Though the crime they actually charged him with was a little different, to say that the primary purpose of the trial was corrupting the youth of Greece would be like saying that the primary purpose of trying Al Capone was his tax evasion.)