because it's president of the united states, not president of america. to become potus, you have to win the different states, and the states are free to determine how they can be won, with most of them choosing winner-take-all, and a couple doing it by district, so you have to win those elections, which means the popular vote doesn't count, and the reason is so it's harder to rig every single county's election.
United States