The Messenger of Allah (sal Allahu alaihi wa sallam) said: “When Allah forbids a thing, He also forbids its price.” [Abu Dawud]
Some people who lived outside Madina did not know about the absolute prohibition of alcohol. One day Amir bin Rabi’ah (radi Allahu anhu) returned from a journey and presented a bottle of alcohol to the Prophet (sal Allahu alaihi wa sallam) – a bottle full of alcohol!
The Prophet (sal Allahu alaihi wa sallam) never drank alcohol, neither in the pre-Islamic days of ignorance, nor in Islam. However, people still used to offer him gifts some of which he wouldn’t use himself but give to others or sell. People would sometimes give him gold or silver which he would not wear but give to his wives or others.
The Prophet (sal Allahu alaihi wa sallam) looked at the alcohol in surprise and said, “Don’t you know that this has been forbidden?”
Amir bin Rabi’ah (radi Allahu anhu) replied, “Forbidden? No! I didn’t know about it, O Messenger of Allah!”
The Prophet (sal Allahu alaihi wa sallam) said, “Yes. It has been forbidden.”
Amir (radi Allahu anhu) then took the bottle away. Some people suggested that he should sell it. When the Prophet (sal Allahu alaihi wa sallam) heard about it he said, “No. When Allah forbids something, he also forbids its value.” Upon hearing this Amir poured the alcohol on the ground.
Notice how the Sahabah immediately acted upon the teachings of Islam, putting aside all other considerations!
Notice how briefly and to the point the Prophet (sal Allahu alaihi wa sallam) gave instructions and made corrections. He didn’t go on and on about it.
Notice that the Messenger of Allah (sal Allahu alaihi wa sallam) did not question the Sahabi’s integrity by saying such things as, “How could you not have known that alcohol is now forbidden!” He never doubted the intentions of the people around him, nor abused them.
This Hadith makes clear that when something is forbidden to consume (such as alcohol), then it is also forbidden to sell it and use the money. Notice that the Sahabi did not gift the bottle on to one of the non-Muslims around either.