I am so sorry
Please son't beat yourself up over this

Your loss is a loss. It may help if you give yourself permission to grieve. It doesn't matter if your baby was growing in you for one day or 40 weeks. It was your baby and your hopes and dreams for that child. Yes losing a baby later on may be harder to handle, but grief and heartache is just that. How do you measure that? Why would we even want to try?
I REALLY believe things happen for a reason. I believe deep in my heart you were meant to give your baby up to someone for answers.
Here is my story:
My heart broke when I flushed my baby down the toilet without knowing it. I was 14 weeks when I m/c.
My baby died at 11 weeks. I got to see "her" little heart beating away while she moved all over just a week before that dreaded u/s that showed my baby who was gone from this world. I had rented a home doppler and on Feb.15 I could no longer find the hb. After three days I called my doctor and they scheduled an u/s. I waited three weeks for my body to let go of the baby. I kept thinking at least I can say goodbye, see her, and bury her. It was THE ONLY thing I had to look forward to. It gave me reason to wake up every morning thinking maybe that would be the day I could say goodbye. I bought a glass jar to put her in, had her spot all picked out...all plans were set and I felt really good about the whole thing. Well March 7th at 6:30am my water broke. I went to the bathroom to clean up and without knowing it....flushed my sweet baby. I didn't know it at the time, but five days later I was worried when the bleeding was stopping and I never saw the baby or the placenta. I called my DR. They did an u/s that showed some tissue still attached. My cervix was still open and I was risking serious infection at that point. I gave in and had a D&C. I could have saved myself the weeks I had to carry a dead baby in my womb. I could have saved myself the pain of the contractions...the blood loss...the sleepless nights waiting for it to finally happen.
I believe strongly that I just wasn't meant to see her. She was meant to live in my memories of a very happy easy pregnancy. She never made me sick, she grew enough that I could know I was pregnant without gaining a pound... I actually lost 5 by 14 weeks but was in maternity clothes. I am not sure what I would have seen if I knew to look at that point.
I really hope something good will come from you giving your baby over to the doctor's office. Things happen for a reason. We just don't always know what they are until later. I was mad as HELL when I figured out what I did. It took weeks for me to come to terms with what happened and why.
Please be kind to yourself and believe things happen for a reason. You may want to join us on the Pregnancy Loss board sometime. The ladies there are as great as the ladies here but we tend to focus more on the emotions that come with a loss.
Lots of hugs to you.... I am sorry you had to go through this. I would never wish this on anyone.