In my commentary on 1 Corinthians by NT Wright, he uses a great illustration for the purpose behind these spiritual gifts. Paul desires that they be used for the body, for love, and to build up. Wright then describes two different building projects in his writings on this section.
And the key question, which he highlights in the first verse, is: are you behaving according to the principle of chapter 13? Are you exercising the gifts God gives you in the spirit of love? The underlying contrast here is the same as we saw in chapter 8, verses 1–2: there are some things which can ‘puff you up’, making you proud and self-important, but what builds people up is love. And this chapter is all about making sure that public worship ‘builds everybody up’ rather than simply everybody developing their own spiritual giftedness and displaying it like so many strutting peacocks. When people come together to worship the God revealed in Jesus, they are not building their own private houses. They are building a great cathedral for all to share and enjoy.