I'd like to see Tubba flesh out the highlighted part - not because I don't believe him but because I'm curious about it.
In any case, it's a matter of fact that the religious opposition against the Shah's regime could freely organize itself under the guise of mosques and religious freedom, while the Shah did crack down on the secular, liberal opposition.
I wish I had the means to give it the treatment it deserves. I have Kinzer's "All The Shah's Men" lying around, but I haven't gotten around to reading it. As you note, a significant issue was that the (warranted) secular critique could be harshly stamped out in the name of anti-Communism. Not so much for the religious opposition.
The Shah operated in a complicated environment. He tried to style himself as a "secular modernizer". He had two big issues - one, "secular modernizers" in the Muslim world that were succesful in some way or other (most notably Ataturk, also Nasser and maybe you could count Saddam Hussein as well, depending on your level of cynicism) defined themselves in defiance of the West. Whereas the Shah had been installed by the West, indeed
replacing the "secular modernizer" who had a public mandate, Mohammed Mossadegh.
The second issue comes with the complicated issue of the Iranian identity. The sense of a continuous Iranian "nation" going back the way to Cyrus the Great can be traced at least to the Ilkhanate of the 14th century. The successors of Hulegu, looking to legitimize themselves, sponsored cultural works that painted an image of a land ruled by a succession of conquerors, starting with Cyrus and ending with Genghis Khan. The sheer destructiveness of the Mongol invasion probably created a bit of a cultural vacuum that could be filled this way. So this persisted to some degree and could be seized upon in the 19th and 20th centuries.
But really, much more tangibly, the modern Iranian state can be traced back to the 16th century, where Shah Isma'il conquered Greater Iran, and was perceived at least in hindsight as a native ruler liberating Iran from the oppressive Turkmen (the Timurids, that is). Isma'il forcibly imposed Shia Islam, and what we find emerging is a national-religious idenitity that exists in opposition to the Ottomans. That's also the origin of the modern Sunni-Shia split.
Of course some of the "succession of conqueror" mentality is also carried through this, culminating with Nader Shah, the "Last Great Asiatic Conqueror", who brought down the Mughal Empire. But what you end up with is very much a dual national culture, carrying both a strong Twelver Shia identity, and an ethnonationalist identity that celebrates its (supposed; the continuity is a bit shaky) pre-Islamic origins.
This leaves a minefield for any modern leader to navigate, and it seems to have forced Mohammad Reza, lacking genuine populist legitimacy, to make a lot of concessions in the rural parts of the country. I think it's ultimately dangerous to think of the Islamic Revolution as coming from "a bunch of nutters". Khomeini, having been heavily influenced by nationalist movements in Europe, seems to have been the one who managed to successfully unify the ethno-national and religious characters of Iran. It really cannot be overstated how much he created a "new direction" for much of the Muslim world, that became even more relevant in the post-Soviet era.
It's very much a land of paradoxes, as the current political situation should make abundantly clear. And that's not even getting into the complicated place of Azerbaijani Turks and "Turko-Persian/Persianate" society...