What the bleep.
You did nothing wrong. What was said to you was incredibly, incredibly rude and potentially very hurtful. Are these people normally complete Negative Nellies? Do they tell people who are talking about upcoming exams "Oh, I wish you hadn't told me. You'll probably fail, you know"?
When I was pregnant last year, I couldn't keep it to myself, but we did manage to restrain ourselves a bit and only told a few people who I would want to tell for support if I miscarried - people who would end up finding out anyway. Sadly we did lose Squidlet, but only one person said anything negative (My sister. When I told her how far along I was, she replied something like "Oh, I won't get excited yet then, you've still got a good chance of a miscarriage."
) and as a result I left it up to our mother to pass on the bad news later. Damned if I was going to give her the chance to say "I told you so".
...yeah, I may still be a tad bitter about that.
*ahem* Anyway. Congratulations! I hope you have an awesomely uneventful pregnancy and nobody else gets foot-in-mouth disease like those twerps! (And if anyone does, I suggest "Wow. That's a horrible thing to say!" as a response.)