I have heard this argument before, of why Jomhoori Eslaami decided to pick a fight with Isra"el". Here's the reason why. Iran is under threat from the United States. Iran knows it cannot hope to win a war with the United States, but what it can do is to make Isra"el" pay the price, knowing that Zionists control the U.S. government. This is like being in a fight with a giant, who is holding you by the throat, and in defense holding a needle to his eye. Should he try to kill you, you can blind him. It deters attack. This is primarily one of the reasons why the U.S. sought a containment policy with Iran, and did not do to Iran what they did to Saddam's Iraq, which is still suffering from endless instability.
It is true Isra"el" was an ally of Iran during the era of the Shah. But don't be certain that the Shah actually liked them or even wanted to continue being friends with them. The Shah partook in the oil embargo of the 1970's. The Shah went on public interview with Mike Wallace and put the Jews on blast for running America. The Shah by then wanted Iran to be a regional power and was not afraid to balance the U.S. off against the Soviet Union to further Iranian interests. He realized this late in his reign, and likely foreign elements decided to empower revolutionaries to oust him. I know for certain the Carter government sought good relations with Khomeini at first, to realize they made a huge mistake and Khomeini would not entertain any kind of relationship with the U.S.
Another thing to consider. If Jomhoori Eslaami didn't pick a fight with Isra"el", it is highly likely that Isra"el", the U.S. largest military base in West Asia, would have begun sabotaging Iran at the behest of the U.S. and perhaps even partaking in a war against Iran. You saw how the U.S. greenlighted Saddam's invasion of Iran and provided him with intelligence and chemical weapons. Don't think Isra"el" would shy away from that citing Cyrus' supposed rescue of the Jews from Babylon. They would have gladly partaken if it meant more aid money from the U.S.
It may seem that Iran picked a nonsensical fight, but it did not. It found the perfect deterrent. As you can see now, the U.S. is on the precipice of another Middle East invasion, and it is trillions in debt with a fragile, non-manufacturing economy, and less of an ability to project power than 20 years ago. Furthermore, Palestine is a cause that Iran promotes. As time goes on, it is evident to everyone that the Arab governments are too cowardly and have forgotten about their fellow Arabs that are being genocided. Iran supporting Palestine, giving them means by which to resist their death at the hand of racial exterminists comparable to the Nazis, ruins their soft power and credibility among normal Arabs while boosting Iran's influence. There are several reasons why Iran decided on its Isra"el" policy and they all make sense from a realist standpoint.