It makes more sense if you look at the United States as a group of individual entities with a Federal level that helps coordinate between them. It’s more like the EU, and less like individual provinces.
Each state decides how to send its electors to vote for the president. Most of the states decided to send them as a winner take all batch of votes, but some decided to allow split votes.
It’s not a perfect system by far, but it makes sense in the context of what it is.