The US (and UK) replaced Mosaddegh with the Shah. Then the Shah and SAVAK (with CIA help) launched a decades long attack on the secular, parliamentary oriented forces in the country. Initially the Shah supported the ayatollahs, and in turn was himself tacitly (sometimes openly) supported by them. Eventually they turned against the dictator under the spell of a foreign power.
Also, Iran had a large communist movement, and it is obvious in 1978 and early 1979 that the US, UK and France saw the communists as the enemy, Khomeini as someone to disempower but not destroy, and the Shah as who to support as long as they could. So that stance helped Khomeini on some level. France would not have allowed communists to sit in France and work successfully to undermine a friendly power (even Indochina, although that stance loosened in the 1950s).