In some ways, Portia's father was very wise to have arranged to organise who his daughter was going to marry through a lottery. Just imagine how difficult it would have been for him to have known that his daughter was going to be left with a huge inheritance, but without his presence to choose a suitable husband for her. This would have left Portia vulnerable to all sorts of fortune hunters and other undesirable men who would have done anything to gain her affection and then marry her for her wealth alone. Arguably, the character of Bassanio certainly seems to be presented as one of these figures if his appearance at the beginning of the play is anything to go by. Portia herself in this scene at least mentions the various restraints that this lottery puts on her, which actually, upon reflection, seem to make some sense:
In terms of choice I am not solely led
By nice direction of a maiden's eyes...
It would be very dangerous if she could marry anybody she wanted, based on their beauty and physical form, or what draws the attention of the "maiden's eyes" that she has, but as she remarks, quite ruefully to Morocco, the lottery means that she cannot be swayed in that particular way.
However, it is also important to consider all of the evidence this play gives us as to the reasons of Portia's father for devising the lottery. In Act I scene 2, Portia and Nerissa have a conversation where Portia complains about her lack of choice and freedom because she is unable to choose who she would like to marry. Note how Nerissa responds to her:
Your father was ever virtuous; and holy men at their
death have good inspirations: therefore the lottery,
that he hath devised in these three chests of gold,
silver and lead, whereof who chooses his meaning
chooses you, will, no doubt, never be chosen by any
rightly but one who shall rightly love.
Her implication is clear: Portia's father was always a "virtuous" man, and such men often have great ideas when they die. His test therefore that he created will ensure that the person who passes it correctly is the person who can "rightly love," or love Portia for who she is and in an honourable way rather than just pretend or feign love in order to get hold of her fortune. As the play continues and the audience becomes more and more aware of the test and what it involves, the logic of Portia's father can be seen, as only somebody who loved Portia for herself without hope of financial reward would select the casket of lead. Therefore, Portia's father was correct to devise the test as he did, as it was the act of a loving father concerned about his daughter and her provision and protection after his death.