then why are they authorized to contest a state’s electoral votes?
The intention of the law was legitimate, but the application of it is completely unconstitutional. The way the law is written, a state that submits one slate of electors can have its electoral votes canceled by an act of Congress for no damn good reason at all. There is no constitutional basis for that.