The 6-to-3 decision upheld Arizona’s policy of invalidating ballots cast in the wrong precinct and a law criminalizing the collection of mail ballots by third-party groups.