Appearances can be deceiving. Jesus sees a fig tree in full leaf from a distance but, upon closer inspection, he discovers that it is barren. He then curses the tree. Jesus sees this fig tree as symbolic of the Temple; impressive from a distance but fruitless.
He makes his point with greater vigor when overturned the money changer's tables and declared, “Is it not written: ‘My house will be called a house of prayer for all nations’? But you have made it ‘a den of robbers.’” (Mark:11:15-17)
Jesus' message is one of judgment against Israel. Jesus is applying the imagery from Jeremiah to the temple.
They dress the wound of my people as though it were not serious. "Peace, peace," they say, when there is no peace. Are they ashamed of their loathsome conduct? No, they have no shame at all; they do not even know how to blush. So they will fall among the fallen; they will be brought down when they are punished, says the LORD. I will take away their harvest…There will be no grapes on the vine. There will be no figs on the tree, and their leaves will wither. What I have given them will be taken from them (Jeremiah 8:11-13 NIV).
God says he’ll judge Israel, and that like a fig tree with no figs, Israel will wither. Two chapters later Jesus will tell his followers that this temple is going to be destroyed (Mark 13:1-2). The destruction of the temple in 70 AD by the Romans was the fulfillment of Jesus’ symbolic judgment enacted here
Outward displays of religion did not impress Jesus then nor does it impress him now. “Produce fruit in keeping with repentance,” he says. (Matthew 3:8)