Money was created as a universal currency of exchange because there was a definite need for some form of currency that multiple people would accept.

For example, lets say there is no currency of exchange but instead just goods. Lets also say a person is trying to sell a truck full of lumber and in return for that lumber, he wants to buy two trucks full of sand. Before money, it would be very hard to find the exact person who wishes to buy his truck full of lumber for two trucks full of sand. With money, it makes this exchange a lot more accessible.

Money acts like an object that everybody wants, completely eliminating the need to find a specific person to trade goods with. Instead of finding someone, the person trying to sell his lumber can sell his lumber to someone else for money, then with that money find a person selling sand and pay him in money.