At least one literary agent thought Obama had a life story in him and she got him a contract. According to one account, she actually told a publisher I am bringing you a book by the man who will be the first black president of the United States. Obama couldn't get a quality book out in time and after it finally did come out and started to sell he treated the agent rather shabbily.
The whole story is pretty shabby, the whole "How I Became Me, or Why I Am So Wonderful" thing. But there were people out there who were willing to buy a story from him and publish it. I suspect they were half looking for an inspiring "Homeless to Harvard" type story and half investing in someone who they thought would at least become a major African-American politician.
A Black Rhodes Scholar like Kurt Schmoke or Corey Booker who plans on going into politics has a lot of doors opened for him, but neither of them got book contracts so young. Possibly the mixed-race and Kenyan angles were considered a draw for readers. Obama's book wasn't going to be either a middle class Black or a ghetto Black story, but something different, and in the eyes of publishers perhaps something more sellable to the (White) mainstream.