Barter is inconvenient and that is one of the reasons why we moved on to money. But it's not the sole explanation.
Even if everybody agrees barter is inefficient, there is no guarantee that others would move on from it - there can be political deadlock that freezes the acceptance of money.
When money is initially adopted, there is inherent risk for the first person doing it. He exchanges something of value for the money and in the process is betting that everybody else in society will start using the money and give value to the money he has.
For almost a year, this is what it was like in Bitcoin. The price was zero despite everybody wanting to give it a price. Bitcoin did not fundamentally change as software when it developed a price - the only thing that changed was people's willingness to trade dollars for it.
In general, there is always an **individual cost** to accepting money, even when the use of money is very widespread. If I work in exchange for money, how do I know that money will still be valuable by the time work is out and I am ready to do my shopping?
If I work for something I can directly consume (barter) then at least I can get some utility out of it no matter what. But if I accept something whose main use is as a medium of exchange, then I am depending on there being people willing to accept that money in the future.
It is the ultimate 'greater fool' scheme, also called 'ponzi/pyramid' scheme used by people who don't understand the term.
In order to explain why people would use money, we need an **individual benefit** to match with the individual cost; otherwise people would never prefer to use money no matter how socially beneficial it was.
This is why people can't just will money into existence and why the inconvenience of a barter system cannot explain the existence of money. There's a risk to it. Historically, institutions like governments have derisked the initial bootstrapping check-and-egg problem by enshrining it in law.
-- an excerpt from It's Not About The Technology, It's About The Money (2016), its 2-minute version can be found here: https://2minutebitcoin.org/blog/bitcoin-is-about-the-money-not-the-blockchain-technology