In Matthew 21 we find that Jesus was hungry and saw a fig tree by the side of the road. As He came close to it, He saw that it had no figs on it, so He cursed it and it withered (Matthew 21:19). It may appear that Jesus is just responding in anger to the tree, cursing it in tantrum-like behavior. But this is not the case at all. One must keep in mind the broader backdrop of Jesus' teaching methodology, which often involved parables and word pictures. Scholars agree that Jesus in the present case is performing a living parable -- an acted-out parable -- to teach His disciples an important truth. His cursing of the fig tree was a dramatic "visual aid."
What important truth does the parable illustrate? Scholars have different opinions. Some say Jesus was illustrating the principle of faith to the disciples. If the disciples had such faith, they too could do such things as withering fig trees and moving mountains (Matthew 17:20). They would need such faith in the hard days to come.
Other scholars believe that since the fig tree had leaves on it (Matthew 21:19), from a distance it gave the appearance of being fruitful. But upon closer examination it became clear that there was no fruit on it at all. So perhaps Jesus' cursing of the fig tree was an acted-out parable that taught the disciples that God will judge those who give an outer appearance of fruitfulness but in fact are not fruitful at all (like the Pharisees).
Still other scholars suggest the fig tree is representative of faithless Israel. Israel professed to be faithful to God and fruitful as a nation, but in fact it was faithless and fruitless. Indeed, Israel had rejected Jesus the Messiah. Israel was thus ripe for judgment. Perhaps the withering of the fig tree foreshadowed the withering (or destruction) of Israel when Titus and his Roman warriors trampled on and destroyed Jerusalem in AD 70, ending Israel as a political entity (see Luke 21:20).
And still other scholars see significance in the fact that the account of Jesus' cleansing of the temple in Mark's Gospel (Mark 11:15-19) is sandwiched between the two sections of Scripture dealing with the fig tree (verses 12-14 and 20-25). It is suggested that perhaps Jesus was teaching that at a distance the Jewish temple and its sacrificial activities looked fine. But on closer inspection it was found to be mere religion without substance, full of hypocrisy, bearing no spiritual fruit, ripe for judgment.
My opinion? I think the second option above -- God judges those who appear fruitful but are not truly fruitful -- has the most going for it.