He was on trial because his disciples committed a coup which lead to the death of about 10% of Athens in 8 months, which then ran away and the closest thing to anyone being on trial was their teacher, who campaigned against democracy, and not once in the trial disvowed his students or even acknowledged the slaughter.
that's why we think he was on trial for bs "corruption the youth" because that's the bs he talked about in his trial (written by Plato after the fact).
he was more like a conservative grifter, Jordan Peterson, or a Nazi propagandists who got sentenced to death for nazi crimes.
look into the 30 tyrants.
also non Platonic contemporary accounts portray Socrates as a grifter, teaching BS for cash while complaining of sophists doing the same (the clouds of Erastophanes).
don't think Socrates was a old kind wise man.