I would tell the truth but tempered a lot with love and concern. By tempered, I do not mean to lie, but leave out personal hurt and angry feelings.
First, there is the obvious; it was not about the child, but the marriage. I would say something like; he left because we didn’t see eye to eye (or whatever). As near the truth as I could get and still leave out blaming and accusing the father for not loving his child. Something like we were too immature for marriage. In addition to it being true or a measure of truth, it will provide great teaching opportunities for a child concerning the relationships they enter into. Life teaches us that it is often difficult to live (even with people we love) together and almost always, if not always both parties can be blamed, so if we really look we can find good things to say about the one who left.
My first wife and I divorced and I made a covenant with myself that I would NEVER put her down in front of our children. She in turn has never said a bad word to them about me. It has paid wonderful dividends over the years. Their friends are amazed when we are in the same room laughing and socializing as good friends. It has been understood that we both love our children immensely and that they had nothing to do with our separation.