The conservative president of Portugal ratified a law allowing gay marriage on Monday.