After looking at photographs of both Frank Marshall and Barry Sr. it seems pretty clear that Frank Marshall is the father of the President. I’m guessing that Frank would not agree to marry Dunham so she hooked up with Barry Sr. to save face and avoid the single Mom stigma.
[Obama’s] nanny was an openly gay man who, in keeping with Indonesias relaxed attitudes toward homosexuality, carried on an affair with a local butcher, longtime residents said. The nanny later joined a group of transvestites called Fantastic Dolls, who, like the many transvestites who remain fixtures of Jakartas streetscape, entertained people by dancing and playing volleyball.
I think the stigma of giving birth to a black baby would have been worse than being a single mom. This was the 60’s and inter-racial marriages or relationships weren’t as common as today.