Homosexuality or at least homoeroticism was actually quite common in Mughal court life.
None other than Barbur, the first Mughal Emperor himself, was known to have had a crush on a boy he saw in Kabul. He even recorded it in his own memoirs, the Barburnama. By all appearances, homosexuality was not particularly frowned upon among the Muslim ruling elite. ...
No, it would have been the Portugese, see here and here.
Was this the first time homosexuality was outlawed in India? If not, who was the very first to do so in the Indo-Pak subcontinent? Was it the one of the Muslim rulers?
Answer: Not the British, the Portuguese (Portuguese India). During the Goa Inquisition commencing in 1560, more ...