"An evil and adulterous generation seeks for a sign, but no sign will be given to it except the sign of Jonah.” So he left them and departed.
The Pharisees and Saduccees came to Jesus in their unbelief asking for Him to do some miraculous sign at their command. This was not faith, it was unbelief. It's the same thing the devil asked of Jesus: "If you are the Son of God... do this". They wanted to control Jesus and dictate His behavior. Jesus is right to call them evil and adulterous. They were placing themselves above God like Satan did and they were acting out of sheer unbelief.
Jesus' response to this rejection of Him was to simply point out their unbelieving motivations AND make a picture of the coming salvation that only He would bring available for their examination. The sign of Jonah (who was 3 days in the fish's belly), served as a picture of Jesus' own upcoming death, three days in the grave, and resurrection. It is a precursor or "coming attraction" of the gospel.
So even though Jesus physically walked away from their unbelief, He still gave the leaders of the Jews a gracious "gospel sign" to consider. The greatest work of God ever to happen was about to occur in the death and resurrection of Jesus. The climax of redemptive history was going to be what Jesus brought. They would find no greater sign than that.