It is natural to question whether you did something wrong in caring for the animal but typically this is not the case. As a foster parent, I have found it helpful to discuss any of these concerns with PAWS staff. I find fostering a continuing learning experience and have realized that some animals just weren't able to make it. The animals that were lost were at least warm, well fed, and loved for however brief a period they were with us. This is more than some unfortunate animals experience in life.
Some people are surprised at how strongly they react when a foster animal dies.
Remember though, you are fostering animals because you care so much about them, so it is natural when they suffer, so do you. Give yourself permission to grieve. You may even find that having a foster animal die brings back other experiences that you have had with loss in your life. One way to help cope with an animal's death is to think about using these feelings in a beneficial way. If I lose part of a litter of kittens, I often look for prospective adoptive homes for the remaining animals.