"You want to be commander in chief? You can start by standing up for the men and women who wear the uniform of the United States, even when it's not politically convenient," said Obama.
The president made his comment Saturday as he addressed the annual dinner of the Human Rights Campaign, the nation's largest gay rights organization.
Obama touted his administration's efforts to repeal "Don't Ask, Don't Tell" and his refusal to enforce the so-called "Defense of Marriage" law which defines marriage as being between a man and a woman.
Still, the president stopped short of endorsing same-sex marriage.