You are absolutely doing the right thing for yourself and your baby. Not every person who comes into our lives needs to stay in our lives. And it's ok to have strong feelings for someone and NOT have them in our lives. You will work through those feelings and you will come to discover that YOU did not cause him to use drugs and there for,you are not his cure.
Stick with what you know is the best for you and your unborn baby and untangle yourself physically and emotionally from what you know is Un-healthy even if that means going no contact with this guy.