I think perhaps we all appreciate such feelings. Sheer joy at recognizing a great friend, soon to be dashed, somewhat, by such pointed dialogue. Why might Christ do that?
Part of it, I suppose anyway, is that a certain balance needed to be restored. Peter had denied Jesus three times; he must then reaffirm Him that often as a sort of penance. It is after through humility that we grow.
And I believe that is the real message, for the rest of us even more than for Peter. Yes, it was also to set up Christ's prediction of St. Peter's martyrdom. But the immediate point was that we must in humility succumb to Christ. And He was using St. Peter to signal that that humility is required of us all.
Yet is also demonstrates that His glory is offered to us all. We simply need the right attitude.