Under Article I, section 1, "All legislative Powers herein granted shall be vested in a Congress . . .." Since all legislative powers are vested in Congress, that means no legislative powers are vested in any other branch.
In fact it is the province and duty of Congress to say what the law is. That is called legislation. The repealing of a law is a legislative function. Who would deny that Congress has the power to repeal laws? Since Congress has that power, the Court does not have it.
Therefore as far as the federal government goes, that function is vested in Congress not the courts. So, the Court can interpret a law, including the Constitution, in deciding a case or controversy, but to declare a law void is not within the Court's delegated powers.
So, just as the article which I posted said: "Judge Moore quite correctly observed that Alabama was not a litigant before the Court in the same sex marriage controversy that led to the Obergefell opinion. So while the 16 couples who were before the Court in Obergefell can get their marriage licenses, its ruling has no binding authority on the state of Alabama."
The Court has the delegated power to decide cases and controversies, even incorrectly, as in Obergefell. But the decision only has proper effect between the parties to the lawsuit.
The Court put the argument slightly differently. The Court said that they were faced with two inconsistent documents - the statute improperly passed by the legislature and the Constitution. The Court argued that it could not enforce both because they were inconsistent and that they were forced to choose whether to enforce the Constitution or instead to enforce a statute that was in violation of the Constitution. The Court chose to enforce the Constitution.
Both sides of the argument played word games. The question of judicial review was inevitable and it probably should have been addressed in the Constitution. But, it wasn't.
Marshall's genius was to claim this power in a case that gave the executive branch a victory. Since the executive branch won the case, there wasn't anything that President Jefferson could do. The Court did not require that Jefferson do anything to enforce the Court's judgment. So, Jefferson had to just watch and seethe.