No, the mistake was not doing more to prevent the Iranian revolution or at they very least ensuring that Khomeini did not take over. If the Iranian Revolution never happened , there likely is a two state solution by now and peace in the middle east.
Also no Iranian Revolution means:
- Saddam likely never invades Iran or tries to later create and empire in the Gulf as Iran would be a major counterweight to it
- We are not as reliant on Saudi Arabia for oil as we are
- We do not need to rely on Pakistan as much to supply the Mujahedeen against the USSR meaning Pakistan does not get the influence they have over Pakistan which means the Tailban may never take over.
The Iranian Revolution was the most disastrous thing to happen in the middle east in the past century and was basically for Islamists what the Russian Revolution was to Communism.
Iran in the immediate period following 1979 was anti-Israel but it was not pro-Palestinian by any means (after all, why would a Shia Persian theocracy care about a bunch of Sunni Arab apostates?). You know who some of the strongest supporters of Saddam going to war with Iran were? The Palestinians. Iran's main concern at that time was providing support to Shia Muslim groups in the Lebanese civil war (which put them at odds with the US, which tended to mainly favor the pro-Western Maronite factions) and higher level political/diplomatic delegitimization of Israel.
Remember that Israel and Iran clearly didn't hate each other enough not to do arms sales at the behest of the US so the Reagan Administration could fund the Contras.
Saudi Arabia and Iran were seen as the "twin pillars" of US influence in the Middle East. Just having Iran alone wouldn't have been enough. It gives you absolutely zero influence with the Arab countries. By the 1970s, Somalia, Ethiopia and South Yemen had all become communist states. The domino theory that was de rigueur in those days suggested if there weren't a US-friendly regime in Saudi Arabia, the red tide could make its way up the Arabian Peninsula and reach waffly non-aligned countries like Syria and Iraq, and threaten the stability of the pro-Western monarchy in Jordan.
The Shah would not have been of any help in Afghanistan, considering even in a timeline where the 1979 revolution doesn't happen, he had terminal cancer and was going to be dead within a couple of years anyway. And he'd have been replaced by his very young son so in practice the country would have been run behind the scenes by the Shah's sister, who was an extremely socially progressive, secular feminist who would have had absolutely zero interest in getting involved with a bunch of fundamentalist Sunni militants.