Andrew Sullivan, in his just released Newsweek cover-essay, explains:
Barack Obama had to come out of a different closet. He had to discover his black identity and then reconcile it with his white family, just as gays discover their homosexual identity and then have to reconcile it with their heterosexual family. The America he grew up in had no space for a boy like him: black yet enveloped by loving whiteness, estranged from a father he longed for (another common gay experience), hurtling between being a Barry and a Barack, needing an American racial identity as he grew older but chafing also against it and over-embracing it at times.
This is the gay experience: the discovery in adulthood of a community not like your own home and the struggle to belong in both places, without displacement, without alienation.