According to the Catholic Encyclopedia:
Those who have held that "water" in the Gospel text is to be taken
metaphorically, appeal to the words of the Precursor (Matthew 3), "He
shall baptize you in the Holy Ghost and fire". As "fire" must
certainly be only a figure of speech here, so must "water" in the
other texts. To this objection, it may be replied that the Christian
Church, or at least the Apostles themselves, must have understood what
was prescribed to be taken literally and what figuratively. The New
Testament and church history prove that they never looked on fire as a
material for baptism, while they certainly did require water. Outside
of the insignificant sects of Seleucians and Hermians, not even
heretics took the word "fire" in this text in its literal meaning. We
may remark, however, that some of the Fathers, as St. John Damascene
(Of the Orthodox Faith IV.9), concede this statement of the Baptist to
have a literal fulfillment in the Pentecostal fiery tongues. They do
not refer it, however, literally to baptism. That water alone is the
necessary matter of this sacrament depends of course on the will of
Him Who instituted it, although theologians discover many reasons why
it should have been chosen in preference to other liquids. The most
obvious of these is that water cleanses and purifies more perfectly
than the others, and hence the symbolism is more natural.
The Catholic Church considers the fire to be symbolic, just as it does with the water.
But some other denominations take it more literally (e.g. Should We Want to Be Baptized With Fire?), especially when considered in light of John's complete sentence rather than the truncated prooftext quoted in the question and used for eisegesis in the Catholic Encyclopedia excerpt.
I indeed baptize you with water unto repentance: but he that cometh
after me is mightier than I, whose shoes I am not worthy to bear: he
shall baptize you with the Holy Ghost, and with fire: whose fan is in
his hand, and he will throughly purge his floor, and gather his wheat
into the garner; but he will burn up the chaff with unquenchable fire.
John is contrasting the two possible final fates that we face. This literal baptism of fire will occur at the end of the world, when all that have rejected salvation and God's holy spirit will be reduced to ashes.