The states can force them to vote a certain way. SCOTUS has ruled.
Are you confusing votes by delegates at a political party convention with Electoral College votes?
I think the Supreme Court did Issue a ruling regarding electoral votes, but I’ve never heard of the Supreme Court issuing any rulings about how delegates to a political party convention must vote.