Shakespeare never reveals why Antonio is so melancholy--even from the play's beginning. Personally, I believe that his depression results from loneliness and from his realizing that he has spent his life making money and belittling his competition (Shylock) and has nothing to show for it. Even though Antonio seems to be well-respected and considers Bassanio a friend, the audience must wonder if he has any true friends. Bassanio is always asking something from Antonio, and the only time that he tries to help Antonio is when Antonio is put in the dangerous position of forfeiting a pound of flesh (a position that he is in because of his own foolishness and because of Bassanio's borrowing money from him).
Similarly, at the end of the play when Antonio's suggestion for Shylock is upheld and all the couples are reunited, Antonio has no one. Granted, he still has his wealth, but he has no one to share it with, not even a friend. I think that Antonio realizes that he is not unlike Shylock, someone whom he constantly berated and disdained. For, like Shylock, Antonio is wifeless, childless, and perhaps even a little faithless after the trial.