They do have things to gain - credibility with the Arab and Sunni Muslim world for fighting against Israel and perhaps defeating it and excuse to operate their proxies and allies. Not to mention they are true believers, and even if they weren't, it doesn't have to be fully rational from your perspective; just from their own.
As for the Jews in Iran, there used to be 150,000 Jews in Iran before the revolution today there are ~9,000. Furthermore IRGC are very much the ideological inheritors of the type of folks who did the Allahdad (God's Justice) Massacre in Mashhad in 1839.
But Iran are Shia! They don't seek Sunni approval; they've been at each other's throats since the beginning!
All of this seems to so insane to me. This region has lots of wealth (dino juice just coming out of the ground), and they're frittering it all away on buying more and more weapons and destroying each other.
They can't gain credibility with the Sunni world; Sunni Arabs are pretty close to their mortal enemies --- not in some dumb religious way, but in a modern geopolitical sense --- and that conflict is far more salient than Israel/Iran.
Iran trying to gain favor with the Sunni Arab world is somewhere in the same ballpark as Russia trying to gain favor with ethnic Ukrainians.