Rasulullah SAW said: "Kill the one who sodomises and the one to who lets it be done to him." (Tirmizi)
Sayyidina Abû Bakr RA had passed such a ruling and Hazrat Ali RA was very severe in his ruling against such a crime. It is established that once Sayyidina Khalid bin Walîd RA found a man in the frontiers of Arabia marrying another man in the way a woman marries a man, so he wrote about it to Abu Bakr RA. When Abu Bakr RA consulted with the Sahabah RA, Ali RA who was the severest in his condemnation of it, said: "Only one out of the many nations had indulged in it and you all know how Allâh had dealt with them. I feel that he should be destroyed by fire." So Abu Bakr RA wrote back to Sayyidina Khalid RA who then put the man to death by means of fire.
Ibn Qassar and Ibn Taymiyyah Rahmatullah alaihim have said: "All the Sahabah RA were unanimous that he should be killed though some of them differed in the manner in which it should be done. Abu Bakr RA said that he should be executed by being thrown from a great height. Another view of Hazrat Ali RA was that a wall should be dropped upon him. Hazrat Ibn Abbâs RA, Ali, Jabir bin Zaid RA, Abdullah bin Ma'mar RA, Imam Zuhri and Imam Malik Rahmatullah alaihim have said that those who commit the evil deed of the people of Lût AS should be stoned to death, whether they be married or unmarried. This is also one of the narrations of Imams Ahmad, Shâfi'î and Abu Thour Rahmatullah alaihim