Paul's main purpose in this letter to the Corinthians was to deal with divisions in the church:
10 I appeal to you, brothers, by the name of our Lord Jesus Christ, that all of you agree, and that there be no divisions among you, but that you be united in the same mind and the same judgment. 11 For it has been reported to me by Chloe’s people that there is quarreling among you, my brothers. 12 What I mean is that each one of you says, “I follow Paul,” or “I follow Apollos,” or “I follow Cephas,” or “I follow Christ.” 13 Is Christ divided? Was Paul crucified for you? Or were you baptized in the name of Paul? 14 I thank God that I baptized none of you except Crispus and Gaius, 15 so that no one may say that you were baptized in my name. 16 (I did baptize also the household of Stephanas. Beyond that, I do not know whether I baptized anyone else.) 17 For Christ did not send me to baptize but to preach the gospel, and not with words of eloquent wisdom, lest the cross of Christ be emptied of its power. (1 Cor 1:10–17, ESV)
But I, brothers, could not address you as spiritual people, but as people of the flesh, as infants in Christ. 2 I fed you with milk, not solid food, for you were not ready for it. And even now you are not yet ready, 3 for you are still of the flesh. For while there is jealousy and strife among you, are you not of the flesh and behaving only in a human way? 4 For when one says, “I follow Paul,” and another, “I follow Apollos,” are you not being merely human?
5 What then is Apollos? What is Paul? Servants through whom you believed, as the Lord assigned to each. 6 I planted, Apollos watered, but God gave the growth. 7 So neither he who plants nor he who waters is anything, but only God who gives the growth. 8 He who plants and he who waters are one, and each will receive his wages according to his labor. 9 For we are God’s fellow workers. You are God’s field, God’s building. (1 Cor 3:1–9, ESV)
Paul contrasted love with gifts that might cause pride. He pointed the Corinthians to love as opposed to pride.
Note the subject of chapters 12 and 14 is spiritual gifts which divided the Corinthians when they should have edified. Paul made the point that love was more important that the spiritual gifts because it will last in heaven.