A federal judge ruled Sunday that Alaska’s ban on gay marriage is unconstitutional, paving the way for gay couples to begin marrying in the state for the first time.