The Supreme Court ruled unanimously Monday that states may require presidential electors to support the winner of the popular vote and punish or replace those who don’t, settling a disputed issue in advance of this fall’s election.

Justice Elena Kagan wrote for the court, and attempted to s…