I agree that your relationship with DH is the problem. DH acted abominably. I do wonder if some of this is payback for the man you were dating that you got pregnant with. (BTW I'm still so sorry for your loss.) Does DH know about him or the pregnancy? Does his family? It is never okay to act rudely to others.
However, I know that I had a hard time being really nice to my SIL who recently separated from DH's brother at Christmas. They were back together just in time for the holiday but I'm still reserving my judgment on the whole situation in general. I think she did him wrong in a major way.
While you might not be the real problem in the marriage, given what you've told us about DH's relationship with his family I suspect he's painted you as the problem to garner their sympathy. They were still out of line in the way you were treated. But I do wonder if they either knew of the affair/pregnancy or if DH has simply painted you as a shrew, do they think they are showing their loyalty to him?