In ancient times, if a person was afflicted with something terrible, they were deemed to be 'unclean' or 'unworthy' as clearly, God had smote them for some trespass.
We now know that conditions such as leprosy are not from God being angry with the person but have very specific causes.
Leprosy specifically is a chronic infection caused by the bacteria Mycobacterium leprae and Mycobacterium lepromatosis and is curable using antibiotics.