Some Jews seemed to think that lepersy was a punishment for sin, rather than a sin itself.
This is most probably going to sound like a stupid question either because there is a specific verse or because there really seems to be no other explanation, but where in the Bible is such indicated? That is what my teachers and priests have told me, but I can't seem to find it in the Bible.
I found this webpage, but it gives me only one verse which doesn't really answer my question:
Incurable by man, many believed God inflicted the curse of leprosy upon people for the sins they committed. In fact, those with leprosy were so despised and loathed that they were not allowed to live in any community with their own people (Numbers 5:2). Among the sixty-one defilements of ancient Jewish laws, leprosy was second only to a dead body in seriousness. A leper wasn’t allowed to come within six feet of any other human, including his own family. The disease was considered so revolting that the leper wasn’t permitted to come within 150 feet of anyone when the wind was blowing. Lepers lived in a community with other lepers until they either got better or died. This was the only way the people knew to contain the spread of the contagious forms of leprosy.
Num 5:2 says
Command the people of Israel that they put out of the camp everyone who is leprous or has a discharge and everyone who is unclean through contact with the dead.
There's a comment in the question that points out 2 Ki 15:5 and another verse Num 12:10 (whose relevance I don't understand).
Num 12:9-11 (NASB):
9 So the anger of the LORD burned against them and He departed. 10 But when the cloud had withdrawn from over the tent, behold, Miriam was leprous, as white as snow. As Aaron turned toward Miriam, behold, she was leprous. 11 Then Aaron said to Moses, "Oh, my lord, I beg you, do not account this sin to us, in which we have acted foolishly and in which we have sinned.
2 Ki 15:4-6 (NASB):
4 Only the high places were not taken away; the people still sacrificed and burned incense on the high places. 5 The LORD struck the king, so that he was a leper to the day of his death. And he lived in a separate house, while Jotham the king's son was over the household, judging the people of the land. 6 Now the rest of the acts of Azariah and all that he did, are they not written in the Book of the Chronicles of the Kings of Judah?
Some context:
I am trying to clarify the claim I make in this Cognitive Sciences stackexchange question about mental illness:
In ancient times (or Jesus's time), uninformed people believed people who had leprosy had leprosy because they committed a grave sin or sins