I was wondering if religion, which I understand is a huge aspect and issue in the subcontinent, was the only reason for the separation of India and Pakistan.
This is a complicated question to answer.
At the outset, I must point out that Muslims and Hindus in India have been separate communities for centuries. The two communities do not mix, and ghettos exist in India even today.
For about 700 years before independence, the Indian sub-continent was ruled by a Muslim minority, whereas the majority of the population was Hindu. The ruling and intellectual elite were Muslims right from the time of the Delhi Sultanate to the last dregs of the Mughal empire. During the Revolt of 1857 too, the Muslim elite played a major role. However, after the defeat of the Revolt, the British dismantled this elite and summarily executed or exiled a large number of people who belonged to this class. These were the people who would have become leaders and representatives of the Muslim community in the years following 1857. The loss of such a large number of educated elite and potential representatives lead to a disproportionally small representation of the Muslim community in the freedom movement and in all interactions with the British.
The Muslim league was formed in 1906 as a body that would represent Muslim Landowners and Landed Gentry. This faction realised that the Congress Party that was dominated by the Hindus and held a socialist world view would not be sympathetic to their claims once the British left, especially since the Congress party claimed to represent the whole of the Indian people, even the Muslim community. The Muslim elite (or what was left of it) thus used religion to their advantage to gain a place for themselves in the ruling polity. The claim that the Muslim people were a separate demographic that could not live under Hindu rulers was put forth. Ultimately, this lead to the demand for Pakistan.
Yes. It's actually plain straightforward. Pakistan was presented as a state for the Muslim minority of India, who as some feared, would not be well represented in a united India. The charter of Pakistan, and its adoption of Islam as state religion make this very clear.
I would also like to add that Pakistan was not envisioned as a hardliner Muslim state. It was intended as a liberal, democratic institution working under Islamic belief.