You are correct that state legislatures are allowed to choose the electors, and Congress is allowed to certify the electoral votes, but that presupposes all sides have followed the Constitution in doing so. Otherwise, their actions were not properly conducted within the Constitution and therefore are not binding. SCOTUS does get to determine if something is constitutional. If SCOTUS decides that an election violated the equal protection clause of 14th Amendment, then the fact that Congress or a state certified it is meaningless, because the whole process is already unconstitutional even before the certification. Indeed, this is exactly the argument SCOTUS used in Bush v. Gore in 2000. So it is not willy nilly invalidating electoral votes. It is invalidating a result specifically because the process used violated the highest law of the land.
In your example, if minority voting rights genuinely had been disproportionately violated due to voter ID, in violation of the 14th Amendment, and that violation demonstrably changed the outcome of the election, then SCOTUS would not only have the right but also the duty to correct the problem. We have arrived at this point in time today specifically because SCOTUS vitiated their oath to uphold the Constitution.
So, no, they never override a legislature's appointments. They simply rule that the legislature never legally appointed anyone in this circumstance because the procedure they used violated the Constitution. Then, they can offer remedies on how to correct the illegal action.
You are correct that state legislatures are allowed to choose the electors, and Congress is allowed to certify the electoral votes, but that presupposes all sides have followed the Constitution in doing so. Otherwise, their actions were not properly conducted within the Constitution and therefore are not binding. SCOTUS does get to determine if something is constitutional. If SCOTUS decides that an election violated the equal protection clause of 14th Amendment, then the fact that Congress or a state certified it is meaningless, because the whole process is already unconstitutional even before the certification. Indeed, this is exactly the argument SCOTUS used in Bush v. Gore in 2000. So it is not willy nilly invalidating electoral votes. It is invalidating a result specifically because the process used violated the highest law of the land.
In your example, if minority voting rights genuinely had been disproportionately violated due to voter ID, in violation of the 14th Amendment, and that violation demonstrably changed the outcome of the election, then SCOTUS would not only have the right but also the duty to correct the problem. We have arrived at this point in time today specifically because SCOTUS vitiated their oath to uphold the Constitution.
So, no, they never override a legislature's appointments. They simply rule that the legislature never legally appointed anyone in this circumstance because the procedure they used violated the Constitution. Then, they can offer remedies on how to correct the illegal action.