Why did liberal student movements support the Iranian revolution?
Did they not expect it to end in theocracy?
Was there infighting once the revolution took power?
Short answer: The Iranian revolution was 'Iranian' rather than 'Islamic' and only gained that character afterwards, during the consolidation of the Islamic Republican Party's rule.
Longer answer:
The Iranian Revolution was a culmination of dissatisfaction with the regime of Mohammad Reza Pahlavi that touched almost all elements of Iranian society. Whilst the 1970's had seen massive economic growth driven by raised oil prices, the increased cash flow wasn't benefiting the majority of Iranians. Equally, the economic growth didn't correspond to any political growth, i.e the Shah showed no signs of democratising.
Students were some of the biggest beneficiaries of the Shah's modernisation policies, which saw university education become much more widely available. However, with this education came exposure to new ideas and political theories, mainly from the West. Students began to demand greater political and press freedoms, and an end to rampant state corruption. Crucially, during the Revolution they were calling for the overthrow of the Shah, not specifying the nature of the post-revolutionary state.
Additionally, central to your question is the notion that there is something inherently separate in the nature of 'liberal' values and the theocracy. Especially in the Iranian context, being young, 'liberal' and educated did not necessarily mean being un-Islamic. Rather, the focus was on bringing about a political system that addressed the perceived failures of Iranian society at that time. Many of the most prominent revolutionary clerics, such as Ali Shariati and Morteza Motahari, demonstrate that the intellectual movements in Iran at this time can combine the Western intellectual tradition with Islam. Shariati in particular combined Shia religious thought with Marxism, and greatly appealed to the youth.
Finally, 'the revolution' didn't take power as such. Rather, the various factions that had come together around the overthrow of the Shah had no coherent vision as to where to progress from there. There was an almost unanimous acceptance of the creation of an Islamic system of government, but this meant different things to different people. Essentially, Khomeini, who had been the figurehead of the revolution, played various factions against the others and gradually consolidated his rule from around 1980-1983.