After 12:31 comes a chapter on the need to love - and to let love drive our desires and actions. Then in chapter 14, Paul picks up:
“Pursue love and desire spiritual gifts, and especially that you may prophesy. 2 For the person who speaks in another tongue is not speaking to people but to God, since no one understands him; he speaks mysteries in the Spirit. 3 On the other hand, the person who prophesies speaks to people for their strengthening, encouragement, and consolation. 4 The person who speaks in another tongue builds himself up, but the one who prophesies builds up the church. 5 I wish all of you spoke in other tongues, but even more that you prophesied...”
Gifts don’t exist by themselves. They are not doled out one at a time, and only one to a person. As God uses a person, he equips them. And those who do well in small matters may find themselves trusted with more.
When we love God and love our fellow christians, we can be content to blossom where God has planted us. Millions of wild flowers are seen only by God, hidden from human view and appreciated only by God Himself. That doesn’t make them any less worthwhile.
But the church at Corinth had become obsessed with easily seen gifts such as tongues. It was being treated as the best gift. And Paul points out that love means we should covet - desire - to be given and trusted with gifts that build each other up rather than ones that benefit the individual:
“I thank God that I speak in other tongues more than all of you; 19 yet in the church I would rather speak five words with my understanding, in order to teach others also, than ten thousand words in another tongue.”
That is my take, anyways. Albert Barnes commented:
In 1Cor. 12, Paul had entered on the discussion of the various endowments which the Holy Spirit confers on Christians, and had shown that these endowments were bestowed in a different degree on different individuals, and yet so as to promote in the best way the edification of the church.
It was proper, he said 1 Corinthians 12:31, to desire the more eminent of these endowments, and yet there was one gift of the Spirit of more value than all others, which might be obtained by all, and which should be an object of desire to all. That was love; and to show the nature, power, and value of this, was the design of the thirteenth chapter, certainly one of the most tender and beautiful portions of the Bible.
In this chapter the subject is continued with special reference to the subject of prophecy, as being the most valuable of the miraculous endowments, or the extraordinary gifts of the Spirit.
In doing this, it was necessary to correct an erroneous estimate which they had placed on the power of speaking foreign languages. They had prized this, perhaps, because it gave them importance in the eyes of the pagan. And in proportion as they valued this, they undervalued the gift of being able to edify the church by speaking in a known and intelligible language.
To correct this misapprehension; to show the relative value of these endowments, and especially to recommend the gift of prophecy as the more useful and desirable of the gifts of the Spirit, was the leading design of this chapter. In doing this, Paul first directs them to seek for charity.