I was in a very similar position last year, my DP wanted a baby, I got my bfp and he had a meltdown! He wouldn't really speak to me and didn't know if he wanted the baby- it was the most awful time.
A few days later I made him tell his dad (they are so so close) and he was suddenly happy about the pregnancy and apologised to me. I think his dad being excited made him feel like all would be okay.
To skim over the next 9 months he was a different person to the one I agreed to marry just 4 days before my bfp, I didn't feel supported and felt like he was keeping me around purely because I was pregnant. He took some interest in the pregnancy, he didn't say it wasn't what he wanted but he has since admitted he was stressed at the thought of having a baby and that is what caused him to behave the way he did.
To be honest, I struggled with the idea of being pregnant too even though he was planned and very much wanted.
Fast forward to now and our little boy is 5 weeks old and his dad adores him and can't believe that he ever doubted the pregnancy and can't believe he acted like he did when he loves the baby like he does. He is a different person, intact he's back to the man I agreed to marry. He has apologised endless times for the way he was, it doesn't make it okay but I love him and want our family to be the best it can be so I'm keeping my (bit of) resentment to myself and enjoying having the man I know and love back and seeing him dote on his little boy.
I'm not saying it will be the same for you but I just wanted to share my experience and hope all works out for you as it has for us. I found the thought of having a baby and the reality was massively different but when he's here you wonder what the worry was for.
Is there anyone he can talk to about the pregnancy who can give him a bit of tough love? To tell him everything will be okay? He might need a few days to get his head together, he doesn't deserve your compassion right now but if you give him a bit of time you might find he realises what a mistake he is making.
I'm not making excuses for him, far from it but it's a massive life changing event and there is stress that comes with that. It would be such a shame for him to ruin your relationship only to find 9 months down the line he'll love that little person more than anything and wish he could go back in time and change his complete outlook.
I really feel for you, you can never get this moment back and I know how horrible it is for it to be ruined like this but your baby will be so worth it.
I really wish you all the best 
