Why Socrates was killed?

Why a Democracy killed an old man for exercising Freedom of Speech.