This is a difficult point and one I reflect on often, in all sorts of ways: did my lack of commitment to faith cause my eating disorder; did my faith help me recover; did I anger God through my ED; did the lies I told harm my relationship with God.
I'm writing this from a Christian perspective but whether you're Muslim, Jewish, Buddhist etc. or perhaps have no faith at all, I think the ideas and concerns we face when dealing with the destruction an eating disorder causes and faith is important to all.
The most important point to remember is that God loves us. No matter what we have done, if we ask for forgiveness our sins will be taken away. That is the blessing Jesus bought us on the cross.