Start with the meaning of the words. To be tragic is to be extremely sad (a bit different from a formal tragedy); to be a comedy in the Shakespearean sense, humor helps but what's necessary is for things to turn out well for the main characters, and, especially, for tensions to be successfully resolved and for lovers to get together.
Well, this is sad because of the frustration and harsh treatment of Shylock, but it is a comedy because Antonio does not lose the pound of flesh he agreed to, and because the lovers marry at the play's end.
tragedy is tragedy. the merchant of venice is tragedy. because the real merchant of venice,"antonio",is sad from beginning to end. he has no problems in life and he has enough wealth to spend his life in luxurious way. he also helps the people and he hates shylock in public.
even in trial scene, when he is in trouble, everyone wants his freedom .the duke also requests shylock for mercy. but antonio does not speak a single word in his defence. either he has no interest to live life or he has faith in god.
here, shakespeare creates tragedy in antonio's character. shakespeare writes the play as art for art's sake.
in this play, shakespeare takes us in happy mood at last.
in trial scene, antonio wins in the court of justice. and portia, in disguise, creates fun for bassanio. according to these scenes, this play is considered as a comedy.
shakespeare gives us a message "how to balance different kinds of situations of life." so, this play is both a tragedy and a comedy.