The Duke of Venice is, well, the Duke of Venice. His role in the play is to uphold the law, which is why Shylock (so we're told) goes running to him after Jessica robs him blind (2.8.1) and when he wants to collect his "pound of flesh" from Antonio (3.2).
As Antonio points out, "the duke cannot deny the course of law." Venice had laws in place to protect non-Venetian traders, who supported the city's economic well-being. ("For the commodity that strangers have /With us in Venice, if it be denied, / Will much impeach the justice of his state" [3.3.4].) When Shakespeare finally gets around to trotting out the Duke at the big trial scene, the Duke can't help Antonio, because Shylock's legal contract is solid. The best the Duke can do is lecture Shylock on the value of mercy, which Shylock completely ignores. Good thing Portia swoops in to saves the day.