Barack Obama and John McCain are at odds over a California ballot initiative that would amend the state’s Constitution to ban same-sex marriage.