Iran has a long History of Persecution of Homosexuals. This
Homophobia anti-homosexuality dates back to Zoroastrianism, one of the oldest religions in the world. Even today Iran is one of few countries in the world which can legally execute gays.
Avesta is primary text of Zoroastrianism. Avesta orders one of the most severe form of Persecution of Homosexuals. If a Person commits homosexuality willingly, then there is no penance for it. He should be put to death and anyone can kill him extrajudicially. Even if a man is raped, the penalty of 1600 stripes apply on him. Probably in Ancient Persia were very strong to sustain pain of 1600 stripes.
Reference: AVESTA>> Vendidad>> FARGARD : 8 Funerals and purification, unlawful sex>>V Unlawful lusts>> Verse: 26-32
Online Source: http://www.avesta.org/vendidad/vd8sbe.htm
26. O Maker of the material world, thou Holy One! If a man, by force, commits the unnatural sin [sodomy], what is the penalty that he shall pay?
Ahura Mazda answered: ‘Eight hundred stripes with the Aspahe-astra, eight hundred stripes with the Sraosho-charana.’
27. O Maker of the material world, thou Holy One! If a man voluntarily commits the unnatural sin, what is the penalty for it? What is the atonement for it? What is the cleansing from it?
Ahura Mazda answered: ‘For that deed there is nothing that can pay, nothing that can atone, nothing that can cleanse from it; it is a trespass for which there is no atonement, for ever and ever.’
28. When is it so?
‘It is so if the sinner be a professor of the Religion of Mazda, or one who has been taught in it.
‘But if he be not a professor of the Religion of Mazda, nor one who has been taught in it, then his sin is taken from him, if he makes confession of the Religion of Mazda and resolves never to commit again such forbidden deeds. ………..
32. Ahura Mazda answered: ‘The man that lies with mankind as man lies with womankind, or as woman lies with mankind, is the man that is a Daeva; this one is the man that is a worshipper of the Daevas, that is a male paramour of the Daevas, that is a female paramour of the Daevas, that is a wife to the Daeva; this is the man that is as bad as a Daeva, that is in his whole being a Daeva; this is the man that is a Daeva before he dies, and becomes one of the unseen Daevas after death: so is he, whether he has lain with mankind as mankind, or as womankind 36
36. [i.e. the recipient is equally guilty. -JHP] The guilty may be killed by any one, without an order from the Dastur (see § 74 n.), and by this execution an ordinary capital crime may be redeemed (Comm. ad Vd7.52).
55. ‘He who burns Nasu (dead matter) must be killed. Burning or cooking Nasu from the dead is a capital crime. . . . Four men can be put to death by anyone without an order from the Dastur: the Nasu-burner, the highwayman, the Sodomite, and the criminal taken in the deed’ (Comm.)