Abortion ruling imperils gay marriage, other freedoms, liberal justices say