It's funny, isn't it? How you think getting pregnant will be so easy, and you do all you can to avoid it when you are younger, and suddenly you want a baby it's much more difficult than you think. Took us nearly 3 years of trying to get number 1 and then number 2 appeared (a little by surprise) 14 months later.
It's not your fault and you've done nothing wrong. These early miscarriages are actually very common. Some believe that the embryo may have had a genetic flaw that would have been incompatible with life.
Have you had any investigations?