Gratiano has a subordinate role in the play, but his presence helps establish the theme of rollicking bachelorhood. In addition, his voice speaks for the larger society of Shakespeare's time.
One of the first scenes in which we get a sense of Gratiano's character is during his discussion with Bassanio regarding a trip to Belmont. Gratiano has broached the topic, suggesting his assertive character, but Bassanio frustrates his intention to travel to Belmont by questioning the Venetian's character:
But hear the Gratiano; / Thou art too wild, too rude and bold of voice. (2.2.180)
Gratiano responds by promising to confine himself to good behavior (2.2.191-198). Thus, he comes across as playful and earnest in obtaining his desires. At the same time, he is revealed through Bassanio to be a bit of a knave.
In the engagement scene between Bassanio and Portia, we see Gratiano's impetuous character. Upon seeing his good friend hitched, Gratiano points to Portia's maidservant, Nerissa, and requests a marriage as well (3.2.210). In this impulsive act, we also see emphasized the theme of fraternity insofar as Gratiano wants to follow his "brother" into the married state.
Finally, in the court scene, we see the mockery Gratiano is capable of bringing against the minority character, Shylock:
A second Daniel! a Daniel, Jew! (4.1.333)
Just previously, Shylock had hailed Portia (disguised as a lawyer) as like the prophet Daniel, who was known for his sagacity and judgement. But the tables were quickly turned on Shylock, who suddenly found himself on the wrong side of the law. Gratiano's repetition of Shylock's triumphal use of this comparison mocks the money-lender and reveals Gratiano's inclination to strike when his opponent is weak. His voice in this scene melds with the sentiment that England at that time in history felt toward Jews, who, on account of their race, were denied the ability to earn an income in the guided trades, and consequently had to take up usury as their livelihood.