Why is the world's reserve currency the US$? That's what the Allied industrialised countries agreed upon in 1944 with the Bretton Woods agreement. The system ended in 1971 but by then the dollar was too important to world trade, so the defacto reserve status continued. The USA was also the primary oil producer in the world (Japan went to war with the USA after the US blocked supply).
The US dollar has many problems, but no one really has a better system. The Euro? That's beginning to look quite fragile after little more than a decade. Yuan? Tied mainly to the US$. Gold? The only people advocating gold are the ones sitting on bullion bars talking their book. The only thing that's certain is that bitcoin won't make any difference to world events.
They did not agree on it. USA had the industry intact and the military might to impose the dollar as reserve currency while Europe was devasted. In fact, the USA government had been trying to impose the dollar on other countries for decades, from late XIX century, early XX century. It all started with the progressive movement when they created the american imperialist mentality. Their moto was: "Extend democracy over the world". The USA imposed the dollar on Mexico, Cuba, Philiphines and more. They even tried to impose the dollar in China but failed. Most of this efforst were supported by military actions, basically totally or partially invading those countries.
So at the end of the IWW the USA government and the interests around it saw the perfect oportunity and imposed the dollar in the world. There is a reason why the USA has military bases all over the world.
Thinking that the rest of the countries agreed to use the dollar is extremely naive. In fact, most of the countries have complained about the dollar as rserve currency, but at the end nobody dares to do nothing about it.