It deliberately gave smaller states more power because without such measures, the big states would always pick the president, and the smaller ones would simply be ignored. This way, Hillary ignoring vital states in the final weeks cost her the election (oh, happy day).Which is why I pointed out the EC gave the small states an unfair advantage over the larger states.
If it's in the constitution, it can't be illegal.