Other than the light-hearted Act IV, scene ii and Act V, the main issues of The Merchant of Venice are resolved by Act IV, scene i when Shylock is forced to renounce his religion. The frivolous ending is presumably added to restore the humor to the previous serious issues and to send the audience away satisfied.
The audiences of Shakespeare's day would have been content to see justice - or their form of it - defeat "the villain,"(I.iii.174) such as Shylock is perceived. The English did not hide their disdain of the Jews and Antonio has already admitted that he will "spit on thee again" (I.iii.126) even though Shylock has agreed to help him and lend him money for Bassanio's love quest with Portia.
The animosity between Antonio and Shylock is characteristic of the division between the Jewish concept of the importance of law above all else versus the compassion and mercy applicable to the Christian concept of the law. Portia epitomises this in Act IV when she asks Shylock to consider setting aside his "pound of flesh" and settle his bond some other way as "it blesseth him that gives and him that takes." (IV.i.182) Shylock is reluctant to do this as he maintains that it is the Christian's poor treatment of Jews, that has made Shylock so bitter: "the villainy you teach me I will execute" (III.i.61-62).
The ending may seem fitting as, despite it seeming as if Shylock would win, Portia manipulates the situation sufficiently to get the better of Shylock. Antonio is just about ready to surrender himself when Portia warns Shylock not to spill Antonio's blood, rendering it impossible to satisfy his bond. The Shakespearean audience would feel vindicated, on Antonio's behalf. However, Antonio should then go on to show the compassion that the Christians claim is basic to their religion. By forcing Shylock to renounce his religion, Antonio is being as unreasonable as Shylock which suggests that there may be some truth in Shylock's claims that it is Christian example that encourages him to "better the instruction" (III.i.62) and claim revenge.