Syria and Iran do not share a common border.
ISIS is not only in Syria....they are very much in Iraq too who does share a border with Iran.
In fact in June 2014 ISIS actually took control of Mosul & Tikrit Iraq...next door to Iran.
Later that same month Obama sent more troops to Iraq.
Iran has two serious problems with ISIS....
ISIS threatens both Syria and Iraq.
Iraq is Iran's neighbor and Syria is Iran's close ally.
Shia Iran does not want extremist Sunni ISIS taking over Syria and Iraq.
If ISIS took over Iraq and Syria that would be a NIGHTMARE for Iran.
Thus Iran was the first country to pledge assistance to Iraq to combat ISIS.
Iran has also launched air strikes against ISIS in Iraq.