Actually, it is a basic legal principle that the enactment of a new law generally serves to repeal a contradictory existing/prior law. Usually, the only way a new law wouldn't do that would be if the existing law was enacted by a higher authority (for example: federal statute or constitutional provision).

There's no federal statute authorizing gay marriage. In fact, the 1996 "defense of marriage act" tended to discourage recognition of gay marriage.

So, unless you're arguing (as the judge did here) that gay marriage is a constitutional right, then CA was fully able to ban gay marriage by passing proposition 8.