Barbara Allen is an old children's folk song. Its earliest known mentioning of the song appears in Samuel Peype's diary. In his diary, he refers to the folk song as "the little Scotch song of Barbary Allen."
In the song, a tale is told of a man (in some versions named Sir John Graeme) is dying. This man has a great love for Barbara, which she refuses to return. When called to the man's deathbed, Barbara simply states to the man that he is dying. It is not until after his death that Barbara realizes that she loved him. She dies very soon after the man. In one version, the two are buried next to each other and a flower grows on each of their graves. The flowers, eventually, intertwine.
As for why Barbara is angry with the man, the poet never gives this information to the reader. One can simply only make assumptions.
Therefore, to offer a personal opinion, I would suggest that Barbara is tired of all the young men wishing to 'woo' her:
In Scarlet Town, where I was born,
There was a fair maid dwellin'
Made every youth cry well-a-day
Her name was Barbara Allen.
Driven away by the many prospects, Barbara may have simply decided to forget any love at all. It is not until the death of the man that she comes to realize that she made a serious mistake.
Barbara caught Sir John flirting with other women, and she would not put up with it. When she saw him again, she realized that he really did love her alone, and she knew she acted too hastily out of jealousy.