Obama privately backed gay marriage while publicly opposing