WASHINGTON—The Supreme Court ruled Monday that Ohio can purge its voter rolls of citizens who haven’t voted in recent elections and don’t reply to efforts to confirm their eligibility, an opinion that opens the door to similar measures in other states.

The case split the court 5-to-4 along ideological lines, mirroring the politics of the issue: Conservatives have favored stricter requirements for voters to demonstrate their eligibility, while liberals have sought to lower barriers to casting ballots.