Extreme situations or hardships can induce extraordinary changes of fortune and unusual or unexpected responses. This could be a situation similar to the wise seeking wisdom from fools or a once rich man reduced to a vagabond.
The tortoise is a cold blooded reptile that requires heat hence in order to regulate its body temperature, it moves in and out of the sun during the day. It would be something out of this world to see the tortoise climb a tree in order to escape cold temperatures. Hence when our elders formulated this proverb they observed that it would take some extreme hardship for such an extraordinary occurrence. Hence similar to the leopard which cannot change its spots, the tortoise cannot climb the tree but the lesson is that extreme conditions may lead to such an astonishment.
The proverb is used to question the depth of hardship by expressing astonishment at an extraordinary occurrence or response. It is an indirect way of pointing out that extreme situations require extreme responses.