Our Lord here shows that he understood that this question, of whether or not Jesus was the Messiah, came from the Baptist himself. Dean Plumptre calls attention to the tender way in which our Lord dealt with the impatience which John's question implied.
"A warning was needed, but it was given in the form of a beatitude, which it was still open to him to claim and make his own. Not to find a stumbling-block in the manner in which Christ had actually come, there was this condition of entering fully into the blessedness of his kingdom."
By this concluding statement, Christ intended to remind them, that he who would adhere firmly and steadfastly to the faith of the Gospel must encounter offenses, which will tend to interrupt the progress of faith. This is said by way of anticipation, to fortify us against offenses; for we shall never want reasons for rejecting it, until our minds are raised above every offense. The first lesson, therefore, to be learned is, that we must contend with offenses, if we would continue in the faith of Christ; for Christ himself is justly denominated a rock of offense and stone of stumbling, by which many fall, (1 Peter 2:8.)
(Excerpt from Pulpit Commentary & Calvin's Commentary)