You have asked an excellent question because it identifies what a versatile symbol the black veil that Mr. Hooper dons is. There are a variety of symbolic meanings that can be applied to the black veil, and it is never precisely specified what the specific meaning is. However, the veil could symbolise Hooper's own secret sin, the sins of his parishioners, and/or Hooper's and everyone's isolation from God. Consider Hooper's last words:
"I look around me, and, lo! on every visage a Black Veil!"
Hooper here suggests that people's own sins cause them to react with fear and horror to the veil, making the symbol all the more awful. This is an impression that is certainly borne out by the story, for when the a group of churchgoers try to confront Hooper about his veil, they are unable to:
Thus they sat a considerable time, speechless, confused, and shrinking uneasily from Mr. Hooper's eye, which they felt to be fixed upon them with an invisible glance.
It is implied that the veil in some way condemns them for their own sin or confronts them with a truth that they do not want to face, and thus they are unable to confront Hooper directly.
For Elizabeth, the fiancee of Hooper, it is clear that she at first interprets the veil as a symbol of some secret sin of Hooper:
"Beloved and respected as you are, there may be whispers, that you hide your face under the consciousness of secret sin. For the sake of your holy office, do away this scandal!"
Yet, by the end of the story it is clear that her continued presence nursing him indicates a change of mind - she has come to understand the symbol as something that applies not just to Hooper but to all humanity.
It is clear therefore that the meaning of the veil is ambiguous, and it certainly changes through the story and depending on the character who is trying to interpret this symbol. However, it can be implied that Hooper himself has donned this veil as a symbol of the universal condition of humanity that will remain separate from God until their death.