An explanation that fits much better is that Ann was having Sex with Frank Davis, and AFTER she got pregnant, they approached Barack Obama and offered him some money to pretend he was the father so as to prevent Stanley Armour Dunham from discovering that his best friend was diddling his daughter.
In everything i've ever read, Barack never acted like he gave a rat's @ss about Stanley Ann. He often forgot he was even married to her, at least until it suited his purpose to be married to her. Something like 10 naked pictures of Stanley Ann have surfaced, and they appear to have been taken in 1960, right about the time she became pregnant. Frank Davis has been conclusively identified as the photographer. This is really not that hard to understand. Barack was the stand in patsy to keep Davis out of trouble with both his wife AND Stanley Dunham.
Except that we KNOW Obama Sr. was a playboy and was screwing around on campus.
Everything points to the conclusion that she was screwing around with him AND with Davis (and maybe others).
While Obama Sr. liked his conquests, he was probably not very happy about getting someone pregnant, and when he found out about Stanley Ann's liaisons with Davis it gave him grounds to take the position that the child was not his. After he found out about Davis, he probably kicked himself for having agreed to marry Stanley Ann (assuming they went through with a ceremony).
That would explain why he rejected her and didn't give a rat's ass about her after that.