Obama says gay marriage ruling 'victory for America'