Typical of both Beatrice's and Benedick's character traits to show disdain for each other and to mock each other, even in this final scene, at first they publicly deny that they love each other. However, both Claudio and Hero present sonnets that they have taken, both written by Beatrice and Benedick, telling of their love for each other.
Since they have been publicly presented with evidence of their love for each other they can't likely keep denying it. However, their confession of love, proposal, and acceptance of proposal have very amusing twists that are also characteristic of the two members of the couple.
Benedick declares that he will have Beatrice for his wife but only because he pities her, as we see in his line, "Come, I will have thee; but by this light, I take thee for pity" (V.iv.97). He is claiming that he pities her because Leonato, Don Pedro, and Claudio have declared that Beatrice was almost ill from unrequited love over Benedick. Therefore, Benedick is claiming he is taking her as his wife out of charity because he pities her condition.
Likewise, Beatrice says that the only reason why she is accepting Benedick's offer of marriage is that both he and others are persuading her to. Also, she says that she is accepting him to save his life because Hero and Ursula both proclaimed that Benedick was ready to die over his unrequited love for Beatrice, as we see from her line, "I yield upon great persuasion, and partly to save your life, for I was told you were in a consumption" (98-100).
Hence the reason that both Beatrice and Benedick give for marrying is to save each other from illness and death. These lines add a great deal of amusement to the final scene of the play because we know that they are spoken in jest. The truth is that both characters have been very fond of each other for quite some time and it is inevitable that they should unite by the end of the play.