Why are parents said to have the right to teach their children whatever they want? What are the underlying philosophical justifications and explanations for this right?

I don't know of any society where parents can teach their children whatever they want without regard to laws and social norms. With respect to laws, for example, a parent could not teach a child that it was okay to act out sexually in a way that the law would regard as involving incestuous sexual abuse. And, similarly, with respect to social norms I think that most people would say that parents have no right to teach their children a virulent racism that promoted the children to treat schoolmates horribly. Both of the examples I gave involved teaching extreme thought that led to unacceptable action, and these cases show that exist significant limitations to parents' rights to teach their children as they see fit. Are there cases where there are limits on what parents could teach their children to believe even when the children do not act on those beliefs? The incest case, I think, shows that there are strong social and perhaps legal limits on teaching "mere" thoughts -- the incest taboo is so strong...

Do the members of a married couple with children have a moral obligation, not (just) to each other, but to their children, to not cheat on each other?

Parents certainly bear many moral obligations to their children, including obligations related to how the parents interact with each other. That said, I don't think that monogamy is morally required of married parents or other parents who live together in a sexual relationship. To the extent that an extramarital sexual relationship could be carried out entirely separate from the family -- and from family responsibilities -- it might be simply irrelevant to parenting. Perhaps many individuals do not have the skills or are not in a situation where to make that separation possible, but some parents may have those skills or be in that situation. Likewise, I suspect there are parents in loving relationships, and who are effective parents, have chosen to reject monogamy and who have also learned how to construct a good family life for themselves and for their children. For more on this, the discussion by the self-described "kinky" communities. So, monogamy may be a useful practice for many...

What is the basis of a person's right to have children?

I think it is also interesting to consider arguments suggesting that procreation should not be viewed as a fundamental human good that individuals should be able to enjoy when they choose to become parents and find themselves in a position to live up to the responsibilities of parenthood. Consider the thought that our uncreated potential descendants deserve our moral consideration. The act of being brought into existence surely is one of great ethical significance, and yet it is an ethically significant act that we "force" upon our children. Could this act of coercion itself be immoral? If so, procreation might be immoral. Or consider this ecological argument: Might the many potential generations of future humans have a moral claim on us not to despoil the earth to such an extent that their lives are severely compromised? Suppose, further, that there exists a maximum population size that beyond which it becomes ecologically and technologically impossible for humans to meet that...

Why is it that even a three-year-old child knows the answer to some major philosophical questions while philosophers sometimes spend their whole lives searching for an answer?

Perhaps this is the answer: Young children and philosophers can both discuss the world in unconventional ways, children because they have not yet learned to think conventionally and philosophers because they have unlearned this. Sometimes children will discuss the world in ways that also interest philosophers; philosophers, however, will address these issues in much more sophisticated ways, and the added complexity of their perspectives makes them much less likely to match a young child's confident assertiveness about the way the world is.