The object he kissed at that moment to him must have represented the highest aspirations of its believers, not their shortcomings, and not their mistaken ideas of what those aspirations should be -- or even the text within it. He was kissing a symbol of their desire to find the right aspirations. I'm sure he was not approving of Islam or accepting any of the teachings. Watch
The Shoes of the Fisherman sometime with Anthony Quinn. The pope literally saves the world from nuclear holocaust. It's quite a fictional story, but it illustrates the passion a pope can have for finding common spiritual ground among peoples.
I don't have that sort of faith myself, but I admire those who do.