No, John the Baptist did not die because God gave him leprosy. He was beheaded by Herod Antipas.
Here's the account from the Gospels:
* Imprisonment: John the Baptist publicly condemned Herod Antipas's marriage to Herodias, his brother's wife. This angered Herod and Herodias. Herod had John imprisoned (Matthew 14:3-4; Mark 6:17-20; Luke 3:19-20).
* Herodias's Plot: Herodias held a grudge against John and wanted him dead. Herod was hesitant to kill John, fearing the people's reaction, as they considered John a prophet (Matthew 14:5; Mark 6:20).
* The Beheading: During Herod's birthday celebration, Herodias's daughter, Salome, danced for Herod and his guests. Pleased, Herod promised her anything she asked. Prompted by her mother, Salome asked for the head of John the Baptist on a platter. Herod, bound by his oath and wanting to save face before his guests, reluctantly ordered John to be beheaded in prison. His head was brought on a platter and given to Salome, who then gave it to her mother (Matthew 14:6-12; Mark 6:21-29).
There is no mention of leprosy in any of the biblical accounts of John the Baptist's life and death. His death was a direct result of Herod's actions, influenced by Herodias's desire for revenge.