The Wedding Guest beats his breast because he has come to attend a wedding, not hear the Mariner's story. The Wedding Guest is torn between the story and the wedding. The first time he beats his breast, it is because he hears the wedding music starting:
For he heard the loud bassoon.
He beats his breast again after the wedding procession begins:
The bride hath paced into the hall,
Red as a rose is she;
Nodding their heads before her goes
The merry minstrelsy.
The Wedding Guest realizes at this point that he will miss the joyous wedding ceremony to hear the Mariner's tale. The breast beating occurring twice is important because it emphasizes both his anguish at missing the wedding and his inability to leave the Mariner. It is as if he is under a spell, riveted to the spot. At the same time, the text makes clear that it is his choice to stay where he is, even at the sacrifice of the wedding:
Yet he cannot chuse [choose] but hear
The story seems important to him and riveting. Despite twice wanting to pull away, he never does.