Your MIL may be stupid but in addition, she is being hostile. That was not an uninformed comment that slipped out innocently. She is being hostile. Your DH absolutely should have stepped in and said something. It is his place to show his mother that he won't tolerate her treating his wife with disrespect.
If you want a snappy comeback, you might say "Regardless of who you think the "real mother" is, this is your grandchild and if you ever want to lay eyes on him or her, I'd better never hear you say anything like that to me again. And I'd better never hear that it was said behind my back either or the consequences will be the same."