This is not the same as, say, Latin America during the Cold War. There, the non-Western cultural antecedents came from indigenous cultures that were naturally collectivistic. Communism was a better cultural fit.
It was perhaps hip to be involved with communism as a young student in Iran. Still....how do you turn a fragmented, tribal, and superstitious country, whose population is made up of several different ethnic demographics, into a communist nation?
That was never a plausible outcome, so I doubt your theory that the US allowed the theocrats to win because it wanted to box out the communists. The US desired to maintain Iran's role as a security base and an investment hub. Neither the communists nor the followers of Khomeini would have allowed either of those two things to continue.
Even today, despite years and years of aligning with China, Russia, Venezuela, Bolivia, and other "leftist" regimes, Iran is not a communist nation. It is a resource-rich dictatorship with a resistance economy.
I think you are over-extending your speculation by saying that Khomeini was the US's horse in the race when it became clear that the Shah would lose power. This is evidenced by the fact that the US assisted Saddam Hussein in the Iran-Iraq War shortly after the Revolution.
They were systematically killed, disrupted, and suppressed during the revolution.
Anyone suggesting that all of this was organic or purely democratic is at best naive, at worst cynically manipulative.