It is never explicitly spelled out in the story why the Reverend Hooper constantly wears a black veil wherever he goes and whatever he does. One thing we do know, for sure, however, is that it completely freaks everybody out.
The black veil looks scary, and it alienates the minister from his flock. Even when he's lying on his deathbed, he stubbornly refuses to take it off. And so, even at the hour of his death, Mr. Hooper remains separated from his parishioners.
Rumors abound that the minister has taken to wearing the black veil because of some terrible sin he committed when the girl whose funeral he presides over was alive. But no one, other than Mr. Hooper himself, knows what the real reason is behind his strange decision.
However, some clues are provided by the minister's last words. As he lies on his deathbed, surrounded by members of his congregation, he utters his final breath:
I look around me, and, lo! on every visage a Black Veil!
One might say, then, that Mr. Hooper's wearing of the veil was a public acknowledgment of his sinfulness. Now we don't know whether he's referring to a specific sin or just a general condition of sinfulness, but it seems safe to say that the black veil is a symbol of sin.
And because of his heightened awareness of sin, Mr. Hooper is able to see black veils on the faces of those standing around his deathbed, even though they're not actually wearing them. In other words, he can see the sin in others, even if they can't see it in themselves.