Hi, I'd like to help you with your question.
There is nothing wrong with your refusal to be abused emotionally by your mother. However, your family may be reacting to you because they may feel sympathy for your mother, who sounds like she has a mental illness. Oftentimes, people who see a situation like this tend to believe only what they see on the surface and do little to understand the whole situation before they choose to pass judgment. That is probably what you are experiencing with your family.
It is understandable that you were upset with your mother's behavior. You are going through some very stressful events including the premature birth of your granddaughter, your medical procedure (I assumed this was planned in advance) and your mother acting out all at the same time. That is an enormous amount of stress to handle all at once. Asking your mother to stay away was not unreasonable.
Also, it was your mother's doctor that admitted her to the hospital so he/she must have seen the same behavior you did in order to feel it was necessary to admit your mother. So you were not the one making the judgment here by yourself. The doctor backed you up as well. That says you did the right thing.
In dealing with your family, it is fine to stand your ground. Let them know nicely as you can that you made the best judgment you could at the time and the doctor backed you up. Then leave it at that. If they choose not to believe you, then there is little you can do to change it. But by believing that you did the best you could at the time, you will help yourself move on from this time.
I hope this has helped you,