The ruling leaves the door open for Republican-controlled states to potentially flip as many as 19 Democratic-held seats by 2028.