First of all please don't be 'disgusted and ashamed' of your dog. He did not spend days planning to do this, and I am sure within minutes he had forgotten he had caused so much upset and distress.
My dog Harry bit a 7 year old girl. She was the daughter of one of my employees. Harry came to us as a rescue and he had bitten before, but never a child. He bites out of fear but the reason dosn't really matter particually, In my mind dogs shouldn't be put in a position where they can cause harm. It was my responsibility to manage the situation and I blame myself entirely, I let Harry get into a situation where he felt he had to react with a bite.
Harry has been with us 9 years, he has not bitten for 8 years after the first year with us he became less frightened and less likely to bite. But I have always known it to be a possibility. The little girl is very dog aware, they have two dogs at home one is a jack russel who does bite! The girl was sat on the floor stroking Harry, he loves children, I was only half watching and was distracted, I did not notice another dog run up and nip Harry on the bum. The dog stood on Harrys tail then ran off. In that instant Harry lunged forward and bit the little girl. The sound was awful and I will never forget it. He caught her face and scratched the skin but bit down onto her arm, fortunately she was wearing a coat, but he must have bitten hard because even through the material there was teeth marks and a lot of bruising. If it had been bare skin it would have been a mess.
It made me feel sick, it still does thinking about what happened. The girls mum had seen the other dog bite Harry and saw how the situation was a freak accident and they knew Harrys history. But I still have a dog who bit a child, and the reality is if the right set of circumstances happened again he would do the same again.
I guess you have to think through if you are able to manage the situation so your dog is never put in a similar position. We already had safeguards in place as we knew with Harrys history he might bite, but it can be exhausting watching them all the time. In the last 8 years I have never left harry with another person, we have a harness on him all the time when we are outside the house as it is easy to grab him if needed. He is such a happy waggy tail dog everyone wants to stroke and fuss him but I have become expert at reading his body language and I can see when he is relaxed and when he is getting stressed, the signs are there. Like others have said your dog will have shown some subtle signs, you may have noticed them, its clear others didn't. I let Harry and the little girl down by not keeping a close enough eye on what was going on. I will never do that again.
If i was in your shoes i wouldn't give my dog up, but I don't think you can ever say 100% a dog won't bite again. People say 'my dog would never bite', but I don't agree its possible to say that. I think you can manage a situation, learn from it and stop a bite from happening because you are careful and doing things right, not because you have a dog that will never bite if that makes sense! Hope you manage to make it work. But please forgive your dog xx