Im happy your brought this up, because its further evidence that Iran isnt typical "sectarian" country as some might think.
"Iranian Taliban" are Sunni, but they go to Iran for support for 2 main reasons: 1) geography - I believe its easier for Taliban in western Afganistan to get support from Iran than Pakistan and 2) ideological difference with ISI/ Pakistani govt/ mainstream Taliban leadership OR ideological alliance with Iran - Any Taliban that are willing to attack US/NATO troops while ignoring counter instructions from Pakistan OR the attack is in Iran's interests, will work with Iran and Iran will support them. I believe there are alot of Taliban who will take outside help as long as doing so doesnt compromise the Taliban's overall goal(s) and ideology
to understand how Iran acts with Taliban or Sunni groups, just understand that things are not black or white. I actually can go ahead and say sustained heavy pressure from US and NATO has made Iran and Taliban movement come to a more middle ground, balanced "understanding" on the Afghan war. Taliban need to take any helpful support they can get cuz this war is long and the aggressors are well financed and have good militaries.