Symbolism, Imagery, Allegory
We also notice how the lottery turns marriage into a competitive game or business venture that entails a lot of risk. (Remember, if a suitor chooses the incorrect casket, he can never marry another woman. But if he chooses correctly, he gets Portia and all of her wealth.) Hmm. It's kind of like all the risky business ventures carried out by the merchants in the play, don't you think?
Does this have something to do with the way Bassanio sees his courtship of Portia as a kind of business transaction that will solve all of his financial problems? Seems like it. The lottery not only allows Portia's father to choose her husband; it also allows him to transmit all of his wealth, via her, to a man of his choosing. Check out "Quotes: Marriage" for more on this.
P.S. This gimmick of a suitor choosing a casket can be found in old folktales, and Shakespeare likely took it from the medieval Gesta Romanorum, which had been translated into English in 1577.