It’s to prevent double voting. Because even federal elections are conducted by the individual states, there is no central register for who has already voted. There’s also early voting. So in theory one could vote on multiple states on the same election.