The roots of the relationship goes back several decades.
By the late 1970s, the state apparatus of the Baath regime under Assad had consolidated into an anti-Sunni orientation. Official propaganda incited Alawite farmers against rich Sunni landowners and regularly disseminated stereotypes of Sunni merchants and industrialists, casting them as enemies of nationalisation and socialist revolution. Bitterness towards the Assadist regime and the Alawite elite in the Baath and armed forces became widespread amongst the Sunni majority, laying the beginnings of an Islamic resistance. Prominent leaders of Muslim Brotherhood like Issam al-Attar were imprisoned and exiled. A coalition of the traditional Syrian Sunni ulema, Muslim Brotherhood revolutionaries and Islamist activists formed the Syrian Islamic Front in 1980 with objective of overthrowing Assad through Jihad and establishing an Islamic state. In the same year, Hafez officially supported Iran in its war with Iraq and controversially began importing Iranian fighters and terror groups into Lebanon and Syria. This led to rising social tensions within the country which eventually became a full-fledged rebellion in 1982; led by the Islamic Front. The regime responded by slaughtering the Sunni inhabitants in Hama and Aleppo and bombarding numerous mosques, killing around 20,000–40,000 civilians. The uprising was brutally crushed and Assad regarded the Muslim Brethren as demolished.
You'd expect party unity between Syrian Ba'ath and Iraqi Ba'ath, but Saadam was labeled a fascist and the Syrian regional branch recognized Khomeni rather early on. Survival and having regional friends were more important than playing games.
Again, the Ba'ath party is 100% secular. Secularism is a cornerstone of their party. It has nothing to do with Sunni and Shi'a here, it has to do with a theocratic regime in a partnership with exactly the opposite.
Heresy is any belief or theory that is strongly at variance with established beliefs or customs, particularly the accepted beliefs or religious law of a religious organization.[1][2] A heretic is a proponent of heresy.[1]
...
Heresy is distinct from apostasy, which is the explicit renunciation of one's religion, principles, or cause;
Atheism is not heresy. A heretic is a type of believer. You can argue you meant the colloquial usage as "divergent thought", but that's not the usage I used.
Either way, the point stands: not all Islam is the same thing, and the Tehran regime quite clearly has an easier time stomaching cooperation with secularists than with Sunnis.