Jews did not necessarily think it was immoral to have leprosy, but most scholars and Biblical commentaries agree that it was a common belief among the Jewish people of Jesus' day that leprosy, as well as disease and disability in general, was caused by sin.
Old Testament evidence
In the Old Testament, there are a number of passage that say doctors are of little value:
As for you, you whitewash with lies; worthless physicians are you all. (Job 13:4, ESV)
In the thirty-ninth year of his reign Asa was diseased in his feet, and his disease became severe. Yet even in his disease he did not seek the Lord, but sought help from physicians. And Asa slept with his fathers, dying in the forty-first year of his reign. (II Chronicles 16:12-13)
Instead, healing comes from prayer to God:
If there is famine in the land, if there is pestilence or blight or mildew or locust or caterpillar, if their enemies besiege them in the land at their gates, whatever plague, whatever sickness there is, whatever prayer, whatever plea is made by any man or by all your people Israel, each knowing his own affliction and his own sorrow and stretching out his hands toward this house, (2 Chronicles 6:28-29)
In those days Hezekiah became sick and was at the point of death. And Isaiah the prophet the son of Amoz came to him and said to him, “Thus says the Lord, ‘Set your house in order, for you shall die; you shall not recover.’” Then Hezekiah turned his face to the wall and prayed to the Lord... Thus says the Lord, the God of David your father: I have heard your prayer; I have seen your tears. Behold, I will heal you. (II King 20:1-2,5)
Psalms 110, brings together these idea nicely:
Some were fools through their sinful ways, and because of their iniquities suffered affliction; they loathed any kind of food, and they drew near to the gates of death. Then they cried to the Lord in their trouble, and he delivered them from their distress. He sent out his word and healed them (v17-21)
Here, "fools" are afflicted with illness because of their sinfulness and are cured when they ask God for help.
Likewise, literature of the Ancient Near East usually attribute illness either to sin or black magic.1
New Testament evidence
In Jesus' time, we have the example of this attitude in John 9:1-2:
As [Jesus] passed by, he saw a man blind from birth. And his disciples asked him, “Rabbi, who sinned, this man or his parents, that he was born blind?”
The idea that illness and disability were caused by sin is so ingrained that Jesus' Jewish disciples assume that being born blind must be the result of sin. They don't even consider the possibility that his disability was not caused by sin. Similarly, the healing of the paralytic in Luke 5:17-30 (which immediately follows the leprosy healing cited in the question) carries a strong connotation that sin and disability were related in the Jewish mindset. In this passage, Jesus first tells the man his sins are forgiven, but the crowd is not convinced so Jesus proceeds to heal the man. Thus, Jesus is playing off their (false) belief that the man was crippled because of his sin.
The Talmud also supports the idea that this was a common understanding among the Jewish people. For example, b. shabbat 55a states "there is no death without sin and there is no suffering without iniquity". Indeed, Genesis Rabbah 63:6 supports the idea that sin can occur before birth. In this passage, Rabbi Yonhanan interprets the story of Jacob and Esah "this one ran to kill this one and this one ran to kill this one [in the womb]".
tsara'ath (leprosy) - especially linked to sin
In regard to צָרָ֫עַת/tsara'ath (usually translated leprosy, although the symptoms don't closely match those of leprosy) specifically, the illness usually develops after a person attempts to challenge authority, a strong indication that it is the result of a specific sin. For example, after Miriam challenged Moses (Numbers 12:10–15) and after Gehazi disobeyed Elisha (II Kings 5:20–27).
When Jesus heals "lepers" in the New Testament, he instructs them to "go and show yourself to the priest, and make an offering" (Luke 5:12-14 as noted; see also Matthew 8:3-4, Luke 17:12-14). This special command, which does not normally follow healings, is further indication that this disease has a special spiritual significance.
The special significance of tsara'ath is backed by Rabbinic interpretation. For example, Arakhin 16a states there are seven possible causes of the affliction, all of them serious sins. Nahmanides described it as a withdrawal of God's presence, noting that the disease sometimes appeared on inanimate objects, such as the walls of one's home.2
1 Encyclopedia Judaica: Leprosy
2 "Tzaraat–A Biblical Affliction" by Tamar Fox at MyJewishLearning