It is not a medicine, but an ailment
Authentic hadithعن وائل الحضرمي أن طارق بن سويد الجعفي سأل النبي صلى الله عليه وسلم عن الخمر، فَنَهَاهُ -أو كره- أن يَصْنَعَهَا، فقال: إنما أَصْنَعُهَا لِلدَّوَاءِ، فقال: «إنه ليس بِدَوَاءٍ، ولكنه دَاءٌ».
Wā'il al-Hadrami reported: Tāriq ibn Suwayd al-Ju‘fi asked the Prophet (may Allah's peace and blessings be upon him) about alcohol. he forbade him from preparing it. He (Tāriq) said: “I only prepare it for medicinal reasons.” Whereupon the Prophet (may Allah's peace and blessings be upon him) said: “It is not medicine, but an ailment.”
Explanation
In this Hadīth, Tāriq ibn Suwayd (may Allah be pleased with him) asked the Prophet (may Allah's peace and blessings be upon him) about alcohol, which he made for medicinal not drinking purposes. The Prophet (may Allah's peace and blessings be upon him) told him that alcohol causes ailments and is not curative. This provides evidence that alcohol is forbidden, as it causes diseases and ailments, and is not useful at all. So it must be destroyed and poured away.
Source · Narrated by Muslim
From the Hadith Encyclopedia (hadeethenc.com).