This miracle was to be a "testimony" to others about Jesus" person ( Luke 5:14). It authenticated His person and His teaching. It also shows the blessings that Jesus brought to people, specifically the spiritual cleansing of those whom sin has polluted (cf. Luke 4:18). [source][source][source]
"Like sin, leprosy [1] is deeper than the skin ( Leviticus 13:3) and cannot be helped by mere "surface" measures (see Jeremiah 6:14). Like sin, leprosy spreads ( Leviticus 13:7-8); and as it spreads, it defiles ( Leviticus 13:44-45). Because of his defilement, a leprous person had to be isolated outside the camp ( Leviticus 13:46), and lost sinners one day will be isolated in hell. People with leprosy were looked on as "dead" ( Numbers 12:12), and garments infected with leprosy were fit only for the fire ( Leviticus 13:52)." [2][source]