If compromising in Tawheed was allowed out of "necessity", then how would you explain Surah Al-Kafiroon?

Surah Al-Kafiroon was revealed in order to declare that a Muslim does not compromise in the principles of the Deen for any "greater good" or "Maslaha".

Like Shaykh Ali Al Khudayr said,

"The biggest Mafsada [harm] is Shirk, and the biggest Maslaha [benefit] is your Tawheed. If your Tawheed is gone, what is the benefit?" 

Ibn Kathir Rahimaullah said in the intro of his Tafsir for Surah Al-Kafiroon,

"It has been said that in their ignorance they [Quraysh] invited the Messenger of Allah, Salallahu Alihi Wasallam to worship their idols for a year and they would (in turn) worship his God for a year. Therefore, Allah revealed this Surah..." [Tafsir Ibn Kathir]

If the Prophet Salallahu Alihi Wasallam didn't compromise on matters of Tawheed even though the Quraysh said they would accept Islam, then how can we use the excuse of "maslaha" to get involved in matters that violate one's Tawheed; like giving allegiance to, or consciously electing a Taghut who you know will be a rival to Allah in His Legislation and implement kufr laws?