Mr. Obama on Sunday gave his deepest condolences to the families of the victims, and he said Americans should, in particular, keep the country’s gay and lesbian community in mind as they offer their prayers.