These type of questions can't be answered in absolute perspective:
One can generate infinite number of questions regarding why some xyz deity did only a particular role in particular abc story ?
Even though let's try to answer this question relatively.
Shaivites may say that even Lord Vishnu wasn't able to consume poison so it was necessary for Lord Shankara to consume it. Vaishnavs may claim that Shiva was able to consume poison only due to grace of Lord Vishnu.
However let's look this story from Vedic Perspective.
Vedic Samhitas (Taittariya and Vajasena) samhita describes Lord Rudra as Nilagriva in various places. For eg. In Taittariya Samhita 4.5.1:
Namo Astu Nilagrivaya Sahasrakshya
Salutations to the blue-necked one and to the one having 1000 eyes (ie. All seeing)
Nilagriva means blue necked one.
As Vedic Samhitas are eternal, so it becomes necessary that some events make the neck of Lord Rudra blue.
So, to respect the Vedic statements Lord Shankara consumed the poison and made his neck blue thus being Nilakantha/Nilagriva. So, Lord Vishnu didn't drank because it was just like pre-ordained event at that time.
In Response to @Krishnas answer Rudra being Mahadeva, Devadeva etc.. only after performing Sarvamedha Yajna.
The context of the verse should only be taken in relative perspective because it contradicts with Shruti passages if taken in absolute perspective.
This chapter of Satapatha Brahmana of YajurVeda clearly gives story of birth of Lord Rudra from Brahma. Brahma just after the birth itself clearly states:
You are Mahadeva.
You are Ishana.
So, in the above chapter of Ashtamurti Manifestation of Rudras he is Mahadeva(the great God), Ishana(the Ruler) from his birth. So, there is no meaning of saying he became only after performing Yajnas.
It also contradicts Shruti passage of Taittariya Aranyaka[10.21] which calls Lord Shiva as:
Ishwara SarvaBhutanam Lord of All Time.
As he is Ishwara of SarvaBhuta (All time) so there is no meaning of saying he became only after doing something.
So, it becomes clear that Mahabharat passage is actually stating Mahadeva is the soul of Gods, as it says "Hutwatatmaanam" ie. Giving self as oblation and then being God of Gods. ie. That Mahabharata passage is actually explaining the Shruti passage of Svestasvatara Upanishad like:
He, the omniscient Rudra, the creator of the gods and the bestower of their powers, the support of the universe, He who, in the beginning, gave birth to Hiranyagarbha−may He endow us with clear intellect! [3.4]
So, it is actually explaining How Lord Shiva created Gods, became self of them by giving oblation of his own self. As the Puranas state "This whole world is the transmutation of Yajna." So that verse is actually explaining how the oblation of self of Mahadeva became self of Gods ie. Devadeva or God of Gods.
Why didn’t Lord Vishnu himself consume the poison during the churning of the ocean and allowed Shiva to do it?
The answer to this is because Shiva, had performed severe austerities to attain the position of the lord of the Devas and by virtue of the merits accrued due to severe penances Shiva was utilized as vessel by Lord Vishnu to consume poison.
Many of these details are from the this blog and also from Padma Purana.
Please check the above link for more details on this episode.
(Meaning): The noble soul known as “mahAdeva” (shiva) performed the sarvamEdha yAga , where He offered Himself as Havis and became the greatest among DevAs. He shines brilliantly in all the worlds with His jnAna, took on eight kinds of radiant forms (ashtamUrthy) and became renowned (keerthimAn ,DhyutimAn virAjathE).
Since Shiva had acquired merit, the gracious bhagavAn Vishnu fulfilled the fruits of his penances by allowing him to swallow the poison and thus lead the Devas as their head.
However, it should be understood that Shiva was a vibhUti and the actual act of containing the poison was done by Lord Vishnu only through the medium of Shiva. This is stated by Shiva himself in the following pramAnAs, which serve as upabrahmaNas for the keSi sUkta:
(Meaning): O Devi, this is not a well known fact. At the time of samudra-mathana, before consuming poison, I meditated on the Lord. (It is due to his mercy that ) I was able to drink it as easily as I had the nectar (amR^ita)
(Meaning): Due to the chanting of the 'nAmatraya' (three names) of that all-pervading Vishnu, that terrible poison, which could have destroyed the worlds, was digested ('jIrNam.h').
In Padma Purana, Uttara Khanda , Section 6; Chapter 232, Shiva says the following regarding the churning of the ocean and halahala or poison episode.
Then at that time when the great ocean was being churned, at first there came up the very strong Kalakuta poison which was very painful, very fierce, and which was like the fire of universal
destruction. [Verses 7-10]
Seeing (it), all gods and demons, being frightened,fled away. O you of beautiful eyes, then seeing the best gods frightened and fleeing away, I (Shiva) said to them: "O you all hosts of gods, do not be afraid of the poison. I shall drink this strongpoison, Kalakuta." Thus addressed by me, all the gods, led by Indra and bowing, very much praised me with the words 'Well, Well'. On seeing the strong poison, like a cloud, having come up I (Shiva) meditated in my heart upon the eagle-bannered god Vishnu, resembling the rising sun and holding a conch, a disc, and a mace.[Verses 11-15]
Having meditated (i.e. when Shiva meditated) with a concentrated mind upon that lord along with Sri and Bhumi, having earrings of gold purified by fire, remover of all miseries, and on my having muttered the great hymn of the name and form (of Vishnu) along with MahalaksmI, all that poison, which was very fierce, which was the first one, which was fearful to all, which was (capable of) destroying all the worlds, was digested (by me i.e Shiva) due to the three names of Vishnu, the omnipresent one. He who,being restrained, would devoutly mutter the three names of Visnu, viz. Acyuta, Ananta, Govinda, beginning with Pranava (i.e. Om) and (also) ending with Om, has no fear of death, so also the great fear due to poison, disease and fire. The wise, restrained one, who would mutter the great hymn—the three names—does not have fear of Death; then from where else (can he have it)? Thus with (the muttering of) the three names(of Vishnu) I (Shiva) drank that poison. [Verses 16-21]
So, all these clearly, indicate that Shiva was able to consume the poison only due Lord Vishnu's grace i.e. it was Lord Vishnu as the inner self of Shiva made it possible for Shiva.
Lord Vishnu didn't drink the poison because he was unable to do it.
Sri Skanda Maha Purana explain that as the devas were over one by greed snd avidya during samudra manthan. The Kalakuta poison came as the anger of Lord Shiva himself. And due to it yhe whole universe including Lord Brahma, Lord Vishnu, Lord Indra, Satya Loka, Swarga, Vaikuntha, etc were burned into ashes and due to the poison Lord Vishnu turned into black coloured.
akāryaṃ kiṃ kṛtaṃ devāḥ kasmātkṣobhoyamudyataḥ |
īśvarasya ca jāto'dya nānyathā mama bhāṣitam || tato devaiḥ parivṛto vedopaniṣadaistathā |
nānāgamaiḥ parivṛtaḥ kālakūṭabhayādyayau || tataściṃtānvitā devā idamūcuḥ parasparam |
avidyākāmasaṃvītāḥ kuryāmaḥ śaṃkaraṃ ca kam || brahmāṇaṃ ca puraskṛtya tadā devāstvarānvitāḥ |
vaikuṇṭhamāvrajansarve kālakūṭa bhayārdditāḥ || brahmādayaścarṣigaṇāśca tadā pareśaṃ viṣṇuṃ purāṇapuruṣaṃ prabhaviṣṇumīśam |
vaikuṇṭhamāśritamadhokṣajamādhavaṃ te sarve surāsuragaṇāḥ śaraṇaṃ prayātāḥ || tāvatpravṛddhaṃ sumahatkālakūṭaṃ samabhyayāt |
dagdhvādo brahmaṇo lokaṃ vaikuṇṭhaṃ ca dadāha vai || kālakūṭāgninā dagdho viṣṇuḥ sarvaguhāśayaḥ |
pārṣadaiḥ sahitaḥ sadyastamālasadṛśacchaviḥ || vaikuṇṭhaṃ ca sunīlaṃ ca sarvalokaiḥ samāvṛtam |
jalakalmaṣasaṃvītāḥ sarve lokāstadābhavan || aṣṭāvaraṇasaṃvītaṃ brahmāṃḍaṃ brahmaṇā saha |
bhasmībhūtaṃ cakārāśu jalakalmaṣamadbhutam || nobhūmirna jalaṃ cāgnirna vāyurna nabhastadā |
nāhaṃkāro na ca mahānmūlāvidyā tathaiva ca |
śivasya kopātsaṃjātaṃ tadā bhasmākulaṃ jagat ||(Sri Skanda Maha Puranam 1:1:9:104-113).
Brahmā said: O Devas, what a wrong thing has been committed by you? Why has this explosive thing cropped up? It is Īśvara’s anger. My speech cannot be otherwise. Thereupon, surrounded by Devas, the Vedas, the Upāniṣads and the different kinds of Āgamas, he proceeded ahead out of fear of the Kālakūṭa. Then, Devas who were worried said to to one another, “We are enveloped in Avidyā (nescience) and lust. How can we do worship and anything to Śaṅkara?” Then Devas kept Brahmā at their head and hurriedly went to Vaikuṇṭha, because they were afraid of Kālakūṭa. Brahmā and others as well as the groups of sages sought refuge in the great lord Viṣṇu, the primordial Puruṣa, the mighty lord who had resorted to Vaikuṇṭha, Mādhava, Adhokṣaja. The groups of Suras and Asuras sought refuge in lord Viṣṇu. By that time, the great poison Kālakūṭa came there. After burning Brahmā’s world at the outset, it burned Vaikuṇṭha.Viṣṇu who dwells in the cavity of the heart of everyone, was burned by the fire of Kālakūṭa also with his attendants. Immediately he acquired the colour of Tamāla. Vaikuṇṭha also became blue in colour. It was surrounded by all the worlds. Hence, all the worlds became encircled by the poisonous substance from the waters. The wonderful poison of the waters reduced to ash the whole of the Cosmic Egg with its eight outer coverings and along with Brahmā. There was no earth, no water, no fire, no wind, and no ether. There was neither Ahaṃkāra (Cosmic Ego), nor Mahat (the Great Principle). There was no Mūlāvidyā. On account of Śiva’s wrath, the entire universe became reduced to ash. (104-113).
Again, By the prayer of Lord Ganesha, Lord Shiva consumed the poison himself and restored the whole universe along with everyone and everything in it.
Lomaśa said: On being eulogized thus by Gaṇeśa, the Lord (Siva), the sanctifier of all living beings, assumed the form of a Liṅga and consumed the Kālakūṭa that arose there and caused the destruction of all the worlds. He made everything free from impurities. Since the lord was endowed with great compassion and considerateness, all Devas, Asuras and human beings and all the three worlds were instantaneously saved. Brahmā, Viṣṇu, Surendra, the Guardians of the Quarters along with the sages, Yakṣas, Vidyādharas, Siddhas, Gandharvas and groups of celestial damsels—all of them got up as though from sleep. They were struck with wonder. (52-55a).
Bdw, as we all know Lord Vishnu took Kurma and Mohini avatar for helping in Samudra Manthan. So, its not necessary for every saguna form of Brahman to do everything. That's why Nirguna Brahman takes various Saguna Brahman forms to perform different different activities. Prd..
Like any library, Hinduism Stack Exchange shares great information, but does not offer personalized advice, and does not take the place of seeking such advice from any Acharya, Pundit, astrologer, Guru or other trustworthy Counselor.