This is one of the more interesting questions about Shakespeare's play The Merchant of Venice. Shylock certainly functions as an antagonist to the young lovers in the play. Although he obviously loves his daughter Jessica, he functions in the conventionally negative role of father as obstacle to a marriage. Shylock's choice of the pound of flesh as a penalty also seems cruel and barbaric.
How Shylock is viewed, though, depends on the question of whether we want to read the text in context or somewhat against its most likely historical interpretation.
In the play, Shylock is almost an anti-Semitic caricature typical of the period in which it was written. He is bitter, greedy, vindictive, and hates Christians. On the other hand, he has one of the most profound and moving speeches in the play, in which he asks:
Hath not a Jew eyes? hath not a Jew hands, organs, dimensions, senses, affections, passions?
As we listen to this, we begin to understand him as a victim of Christian prejudice. Thus most twenty-first century critics, especially in light of the Holocaust, see him as a complex character rather than a pure villain.
In general, unlike popular movies or comic books, serious literary works tend to have complex characters rather than simple heroes and villains. This is one of the differences between most literary works and most popular ones.