Hi, good question.
ねました is the past tense of ねます, and in many cases, we translate it "to go to bed", an action in a moment. So 私はねました means "I went to bed".
on the other hand, ねていました is the past tense of ねています which means "to be sleeping" or explains the situation of being sleeping (with duration)".
So 私はねていました means "(when something happened or in that moment,) I was sleeping".
I hope you understand it but it's not, please let us(me) know.