You are mistaken. Communism by definition does not allow the right of private ownership. It is one giant tax upon everything you produce. The state owns it, the state owns everything, and will take what it wants and give you what it decides. That is not freedom.
They may have both been part of the same pool of resistance against the Shah in 1979, but the situation was more that of Islamists entering as a factor with the arrival of Khomeini, and then replacing Communists, and that in a most harsh way.