Read up on the electoral college. Clinton got more votes...It doesn't work.
It's designed that way so that bigger states with more people don't have cart blanche and smaller states with fewer people don't get just trampled underfoot.
You can debate if it's really a good thing that we have a system in place to try to balance out such things, but asserting that the electoral college doesn't work because Trump won with fewer votes basically says "I don't actually understand the thing."
It works exactly as it was designed to work.