Ramanujacharya was not being asked to worship Shiva. Now if he had been asked to do that, he might well have refused; as discussed in this answer Sri Vaishnavas who have performed Sharanagati often do not worship other gods. That's not out of hatred towards other gods, but because after performing Sharanagati you're basically "married" to Sriman Narayana, and so worshiping other gods would be like cheating on your spouse. (This doesn't apply to Sandhyavandhanam and the like.)
But Ramanujacharya was not asked to say a prayer to Shiva. Instead what the Shaivite Chola king wanted him to do was to become a Shaivite, i.e. to declare that no one is superior to Shiva. Here is Alkandavilli Govindacharya, a descendant of one of Ramanujacharya's disciples, says in this excerpt from his book "The Life of Ramanujacharya":
The Chola-king, for the time being, happened to be a most bigoted Saiva. He was bent upon destroying Vishnu temples, and otherwise prosecuting Vaishnavas, though his son (Vikrama Chola. 1113—1128A.C), wisely hinted that he bad set to him self an impossible task, inasmuch as he could never destroy the two strong props of the Vaishnavas, the Tiruvdymozhi of St. Nammazhvar and Ramayana of Valmiki. The Saiva system is anti-Vedic, and Vaishnavas condemn it as un-Aryan and erroneous. The king, then resident at Chidambaram (or Gangaikonda Cholapuram) was so bigotted an adherent of this system that he adopted coercive measures to bring men of all other faiths into its fold. For this purpose, he had a proclamation issued in which was written: "There is no (God) greater than Siva;" and every one, especially every learned man, was commanded to affix his signature to the document in proof of his assent to this proposition. Many obeyed either for fear of being punished, in case of refusal ; or on grounds of conscience, or enticed by hopes of rewards of land and money from the king ; and others deserted the country and hid themselves. Naluran, a disciple of Kuresa, happened to be the king's minister. " What is the use, your Majesty !" said he "of your obtain ing signatures from all men indiscriminately. No good purpose is served thereby. If you can obtain the signature of the two veterans of the Vaishnava faith, Kuresa and Ramanuja, living in Srirangam, that will be a capital stroke of policy, and your declaration about Siva's pre-eminency will only then have
received irrefutable testimony." Chola immediately directed messengers to go to Srirangam and bring Ramanuja. They arrived and standing before the gate of the monastery, declared their errand, and said that Ramanuja must go with them to the King's Court forthwith. The door-keepers rushed inside and whispered the news softly to Kuresa, 1 who was then engaged in serving bath-water to Ramanuja. Kuresa foresaw the dangers of persecution that threatened; and without tell ing Ramanuja what he meant doing, he donned the colored robes of Ramanuja, and taking up his tridanda, emerged from the monastery; and saying: "I am Ramanuja, proceed," to the King's men, stepped on. Mahapurna, observing this, followed Kuresa on this ominous expedition.
But to declare that there is no one superior to Shiva would violate Ramanujacharya's most fundamental beliefs. For the Pancharatra Agamas state that there is someone superior to Shiva; Shiva is a Jiva who is the son of Brahma, and the being who dwells in Shiva's heart is Vishnu's Vyuha form Sankarshana, who emerges from Vyuha Vasudeva who lies down in the ocean of milk, who emerges from Para Vasudeva, the supreme Vishnu. (See my answer here for more information.)
And Ramanujacharya's guru's guru Yamunacharya gave a detailed scripture-based argument on the subject of Vishnu's supremacy and Shiva being a Jiva in this excerpt and this excerpt from his Agama Pramanya. Also, here is what Ramanujacharya says about the practices of Shaivism in this section of his Sri Bhashya:
So far it has been shown that the doctrines of Kapila, Kanâda, Sugata, and the Arhat must be disregarded by men desirous of final beatitude; for those doctrines are all alike untenable and foreign to the Veda. The Sûtras now declare that, for the same reasons, the doctrine of Pasupati also has to be disregarded. The adherents of this view belong to four different classes--Kâpâlas, Kâlâmukhas, Pâsupatas, and Saivas.... With regard to these views the Sûtra says 'of pati, on account of inappropriateness.' A 'not' has here to be supplied from Sûtra 32. The system of Pasupati has to be disregarded because it is inappropriate, i.e. because the different views and practices referred to are opposed to one another and in conflict with the Veda. The different practices enumerated above, the wearing of the six mudrâs and so on, are opposed to each other; and moreover the theoretical assumptions of those people, their forms of devotion and their practices, are in conflict with the Veda. For the Veda declares that Nârâyana who is the highest Brahman is alone the operative and the substantial cause of the world, 'Nârâyana is the highest Brahman, Nârâyana is the highest Reality, Nârâyana is the highest light, Nârâyana is the highest Self'; 'That thought, may I be many, may I grow forth' (Kh. Up. VI, 2, 3); 'He desired, may I be many, may I grow forth' (Taitt. Up. II, 6, 1), and so on. In the same way the texts declare meditation on the Supreme Person, who is the highest Brahman, to be the only meditation which effects final release; cp. 'I know that great Person of sunlike lustre beyond the darkness. A man who knows him passes over death; there is no other path to go' (Svet. Up. III, 8). And in the same way all texts agree in declaring that the works subserving the knowledge of Brahman are only those sacrificial and other works which the Veda enjoins on men in the different castes and stages of life: 'Him Brâhmanas seek to know by the study of the Veda, by sacrifice, by gifts, by penance, by fasting. Wishing for that world only, mendicants wander forth from their homes' (Bri. Up. XI, 4, 22). In some texts enjoining devout meditation, and so on, we indeed meet with terms such as Pragâpati, Siva, Indra, Âkâsa, Prâna, &c., but that these all refer to the supreme Reality established by the texts concerning Nârâyana--the aim of which texts it is to set forth the highest Reality in its purity--, we have already proved under I, 1, 30. In the same way we have proved under Sû. I, 1, 2 that in texts treating of the creation of the world, such as 'Being only this was in the beginning,' and the like, the words Being, Brahman, and so on, denote nobody else but Nârâyana, who is set forth as the universal creator in the account of creation given in the text, 'Alone indeed there was Nârâyana, not Brahmâ, not Isâna--he being alone did not rejoice' (Mahopanishad I).--As the Pasupati theory thus teaches principles, meditations and acts conflicting with the Veda, it must be disregarded.
And indeed, when Ramanujacharya's shishya Kurathalwan and his guru Periya Nambi (Kuresha and Mahapurna in Sanskrit), they also gave detailed scripture-based arguments for why they could not possibly accept the proposition that there is nothing higher than Shiva. This got them their eyes plucked out, as described in another excerpt from Alkandavilli Govindacharya's "Life of Ramanujacharya":
[T]he two good men, as you are aware, were taken to Chola's presence, and Chola commanded them to set their signatures to the written declaration .- "No higher being than Siva exists." But Kuresa poured out before him voluminous authorities from the Vedas, Upanishads, Smritis and Puranas, proving that Narayana was the Highest God, being the Cause of the cosmos, as also its Author for creation, sustention, and dissolution, and therefore the only Object of worship and contemplation ; and that Chaturmukha Brahma and Rudra were respectively His son and grandson ; and cited other verses to demonstrate his position. But Chola after all said in angry tones :—"Look here, thou art indeed a very clever person, and therefore capable of interpreting authoritative texts to suit thy own preconceived prejudices. I will not hear all this. Here is my circular containing the statement : "There is no higher than Siva." I command thee to sign it without another word of protest". Kuresa took the paper, but before attaching his signature thereto, wrote :—
' Dronam asti tatahparam' and then signed his name under it. The meaning of this passage is : " But drona is higher than that." This, and " Sivat parataram, nasti," meaning : 'there is no higher than Siva,' together make a couplet in Sanskrit verse. Taken together, they read :—" There is no higher than Siva; but Drona is higher than that (Siva)." By this Kuresa implicated a pun on the terms Siva and Drona ; Siva meaning a small measure, and Drona, a greater measure. This play on words was taken as a slight and affront which necessarily threw the king into a rage, who exclaimed : "Pull out the eyes of this daring jester." "But" exclaimed Kuresa in return, thou needest not take that trouble, tyrant ; I will do that act with my own hands, for my eyes ought not to remain after seeing a sinner like thyself." A martyr to the cause of Vaishnavism, Kuresa, so saying, gouged out his eyes, striking terror into all who witnessed this blood-curdling scene. The cruel king now turned to the venerable old acharya Mahapurna, and cried :—" Now, Sir, will you sign this circular or no?" Purna said he could not, supporting his refusal by citations from various scriptures. On this, the king commanded his myrmidons to catch the dissenter and pluck out his eyes. This cruelty having been inflicted the king drove the two martyrs out of his palace.
On a side note, unlike the Chola king Ramanujacharya never forced anyone to become a Sri Vaishnava. Ramanujacharya's cousin Govinda Bhatta was voluntarily persuaded, not forced, to rejoin the Sri Vaishnava Sampradayam.