Q:

Why was Khomeini in France? Who allowed him to leave and why?

I never knew that Khomeini was in France until I saw What was President Jimmy Carter's role in the Iranian Revolution?. 
Why was Khomeini in France? Who allowed him to leave France and why?

A:

Khomeini was in France because he had been expelled from Iran and then Iraq, and his aides had advised him to go to Europe, and because France granted him political asylum. He was at the time an aged and relatively obscure religious figure, a target of political persecution who had not been to his home country in well over a decade. They probably saw him as harmless.
He was allowed to leave because he had broken no French laws, nor done anything else that would cause the French authorities to force him to stay.
I'm sure within a few years, with French hostages in Lebanon and bombings in Paris over the Lebanese crisis, the French regretted both decisions— but that is hindsight, and hindsight as they say is 20/20.

Ruhollah Khomeini came to prominence for opposing various actions and policies of the government of Shah Mohammed Reza Pahlavi in the early 1960s, such as removing the requirement for public officials to swear oaths on the Koran, and the appropriation and redistribution of land from religious estates. He was imprisoned and kept under house arrest for a period, then on November 4, 1964 deported to Turkey.
He remained in Turkey less than a year, then relocated to Najaf in Iraq, where he spent most of the remainder of his exile. He continued to agitate against the shah's regime, and as antigovernment sentiment intensified in Iran throughout 1978, the imperial government wanted to increase his physical distance from Iran. They pressured Iraq to expel Khomeini, and he was deported to Kuwait on October 6, 1978.
He had originally planned to relocate to Syria, but his aides noted that he would be monitored and highly restricted if he stayed anywhere in the Middle East. He requested and received political asylum in France instead, and on October 8 he relocated to a rented house in Neauphle-le-Château outside of Paris.
The move was a huge boost to his cause. It put him within reach of the international news media and sympathetic (at least in their opposition to the shah) intellectuals, but perhaps more importantly, the phone infrastructure in Europe was far more reliable, enabling him to stay in close touch with contacts in Iran and participate in the groundwork for the post-imperial regime. If he had stayed in southern Iraq, who knows whether he would have had such a profound influence on subsequent events.

