- 51% of people can do wrong against the other 49%.
- 51% of people can do wrong against themselves by making an uninformed decision.
- Tomorrow the 51% become the 49% and vice versa. If unchecked power was given to whoever was currently 51%, it would spell whiplash and chaos.
So you structure the whole thing into smaller deliberative bodies where people (who are periodically selected by 51% majorities) have better information and means to strike good compromises that are unattainable through raw public opinion. A fuller and more appropriate name for this is "a democratic republic", for which "democracy" is used as a shorthand.
Some of these bodies have authority only over local areas, because you can make a more tailored decision when you have fewer things to deal with. Some of these local bodies, as another commenter noted, may conduct referendums to decide whether to make a law. Other bodies have authority over the whole land, but only over coarse-grained topics with only highly limited authority over the smaller local bodies.
And at the highest level, there is one body where people's very local representatives have a vote and another body where people's region-wide representatives have a vote, and these bodies must agree in order to do most things.
And you make one small body almost completely insulated from public opinion so that you can task it with protecting not just 49% from the whims of 51%, but protecting one individual person (yes, even a guilty criminal individual) against the rest of the government and against whatsoever the remaining 330 million people may think of this person.
And yes, the vote for the president is not a raw popular vote. There is a level of indirection through another body that often does, but may not, yield the same result as a popular vote would. But it does not logically follow that Americans do not vote for their president.
And you don't let the president make laws or rule on cases or send the country to war.
The guiding principle is not to let one person or one group of people have too much power. A majority of Americans having consensus on a given issue is one such group whose power is intentionally limited.
Could the whole thing be designed better than it is? Of course. Will people always screw it up no matter how well designed it is? Of course.