The Torah elsewhere in Parshas Shemos tells us that when Pharoah’s daughter Bitya came down to the river and saw the basket containing baby Moshe floating by, she stretched out her hand and tried to grab it. Chazal tell us that there was no way Bitya’s arm was long enough to reach the basket, yet, despite the long odds against her success, she made the effort. As a result, Hashem performed a miracle and her arm stretched long enough for her to recover the basket and save Moshe.
In one of R’ Reisman’s parsha shiurim he points out that at first glance these two Chazals seems contradictory. Yosef is criticized for making a desperate effort; Bitya is rewarded for making a desperate effort. What’s the difference between the two episodes?
R’ Reisman suggests (and a similar idea can be gleaned from this article) a distinction between hishtadlus in areas of gashmiyus vs. hishtadlus for ruchniyus. Yosef’s situation was one of physical discomfort. His escape from prison would improve his material situation. Given those stakes, the amount of hishtadlus permitted is only what which would otherwise be perceived as “normal.” How much effort would you make to get a better job, a better house, etc.? It has to be within the realm of reason, not an act of desperation. The situation facing Bitya was one of life or death -- Bitya was presented with the opportunity to do the mitzvah of hatzalas nefashos. In those circumstances, there is no limit to how much effort you should put in, no matter how long the odds are against your success.
I would like to suggest another possible distinction. Yosef’s hishtadlus was to better his own situation. In those circumstances, one can be held accountable for being too invested in the situation, for losing sight of what is an appropriate response. Think of the business owner, for example, who works later every night and every weekend with no break, without stopping to think that at some point success is b’yad Hashem and the extra weekend at the office is not going to make a difference. Bitya’s hishtadlus, however, was on behalf of another – on behalf of baby Moshe. When you are acting on someone else’s behalf, there is not the same danger of getting swallowed up by the situation. Think of the employee who comes to work every day and clocks his 9 to 5 shift and then goes home. He has far less invested in the success of the business than the owner, and his effort shows it. In those circumstances, even when, as in the case of Bitya, one takes a chance with long odds of success, the distance from the situation that comes from being an outside party ensures there is no loss of bitachon involved.