How can the pope marry a couple on an airplane? Isn't that against the doctrine of the Church on many levels?
No, it is not against the doctrine of the Church. There is a difference between divine law and Church law when it comes to marriage. The pope can dispense from all Church laws, but he cannot dispense from divine law. Therefore, as long as there is a man and woman who are free to marry and intend to commit to everything the Church teaches about marriage, then all divine laws have been fulfilled. This is why marriages between two non-Catholics in a non-Catholic setting are valid.
The pope can dispense with all Church laws regarding paperwork, time frames, and place because he is the supreme legislator, executor, and judge of the laws of the Church.
In this case, it appears that the couple had previously fulfilled all the proper procedures to be married in a church several years ago, and then an earthquake destroyed the church and devastated their community, and they were yet to reschedule their church wedding. So it would appear the only dispensation they need was a dispensation from place in order to be married on the plane. However, the Holy Father can dispense from all Church laws.
The Code of Canon Law:
The bishop of the Roman Church, in whom continues the office given by the Lord uniquely to Peter, the first of the Apostles, and to be transmitted to his successors, is the head of the college of bishops, the Vicar of Christ, and the pastor of the universal Church on earth. By virtue of his office he possesses supreme, full, immediate, and universal ordinary power in the Church, which he is always able to exercise freely (can. 331).