Not all Nagas were destroyed in fire sacrifice. All the crooked, heinous and violent progeny of Ananta, Vasuki, Kambala, Karkotaka, Padma, Maha Padma, Sanka and Kulika were destroyed in fire sacrifice except their ancestors. This curse was given by Lord Brahma to serpents. This is described in Chapter 24 of Varaha Purana.
Brahma said,
Patala, Vitala, Sutala are the regions allotted to you. You may all
have your abode there.I ordain that you shall enjoy all pleasures till
seventh Manvantara At the beginning of Vaivasta Manvantara you will
become relations of Devas as well as of Garuda. Then all your progeny
will be consumed by fire but for your own selves there will be no
danger. The end of such serpents as are fierce and insolent will
certainly occur, but not of others. You may eat and bite person if he
is destined, but also to retaliate when somebody injures you.
Mahabhartha Adi Parva: Astika Parva: SECTION XXXVIII too says the same.
The gods said, 'O Grandsire, thou god of gods who else than the cruel
Kadru could thus, after getting such dear children, curse them so,
even in thy presence? And, O Grandsire, by thee also hath been spoken,
with reference to those words of hers, 'Be it so.' We wish to know the
reason why thou didst not prevent her.' Brahma replied, 'The snakes
have multiplied. They are cruel, terrible in form and highly
poisonous. From desire of the good of my creatures, I did not prevent
Kadru then. Those poisonous serpents and others who are sinful,
biting others for no faults, shall, indeed, be destroyed, but not they
who are harmless and virtuous.