How to explain to college that religious observance precludes me from living on campus, as required? I am planning to attend a college that requires students to live on campus, in a coed setting. As an observant Muslim, I cannot do that.

The college asked me to write a letter explaining why I cannot live on campus. I also have to explain why I can't eat the cafeteria food. 

I'm asking how I should start the letter, and what I should say in the letter.
This kind of letter should typically be brief and straightforward. Unless they have told you specifically what should be in the letter, you can write:

To whom it may concern:
Please be advised that, as a Muslim, my religious observance precludes me from living on a coeducational campus. As per the advice of [person or office who told you to write the letter], I am writing this letter to request an exemption from the on-campus living policy.
Thanks for your consideration,
Nimbra

If you want, you can also include contact information for a member of the clergy (i.e., a religious leader) who knows you and can vouch that you do, in fact, have such a requirement. (Sometimes this is required as a matter of policy; for example, those who cannot take the SAT on Saturday due to religious observance must provide a letter from clergy attesting to this.)