Why does a mother claim that the father is unknown when her first child is born, but then marries him shortly afterwards and gives the child to relatives?

In my extended family there is a cousin whose parents and brother do not treat him like family, but as if he were a stranger. His mother (a distant cousin of mine) had him when she was still unmarried. Although she was in a committed relationship with the child's official father at the time, the…