The US is not a pure democracy. The electoral college is one of the checks on majority rule. It is not violating the principle of equality of voting, because it gives every state a proportional voice based on their population.  The states that have more of a say also have a larger population of voters, therefore it is proportional. California has the largest population for any state, and therefore gets the largest number of votes in the electoral college.