Why do some countries have different voltages than others? Why is there no universal plug like a USB?
Why do some countries drive on the left and others on the right? Why do some countries use different currencies? Countries picked a standard at one point and now they are generally pretty much stuck with it. As Wikipedia tells us:
The choice of voltage is due more to historical reasons than optimization of the distribution system—once a voltage is in use and equipment using this voltage is widespread, changing voltage is a drastic and expensive measure.
There are some advantages and disadvantages to different voltages (mainly around the cost and waste involved in distributing electricity), but the cost and inconvenience of switching electrical systems for a whole country is huge: the electrical utility would have to change transformers across the country, and everyone would have to replace large and expensive appliances (or install large and expensive transformers, which aren't 100% efficient and would "waste" additional electricity). If the mains voltage is increased, devices intended to work with the lower voltage could be permanently damaged or even catch fire. If the mains voltage is decreased, devices intended to work with the higher voltage could stop working or work ineffectively.
USB is emerging as sort of a universal standard for low-power electronic devices, but even there it's not so much of a standard. There are different USB charging standards, some official and some de facto, and the entire situation is a bit of a mess. USB-C, which is a new physical connector with new charging specs, tries to solve some of these problems, but it also means yet another standard to deal with. USB is also completely unsuitable for high power applications, which, in residential applications, can be anything from a hair dryer to an electric oven or air conditioner (USB-C can deliver up to 100W, while even something like a toaster or microwave will draw on the order of 1,000W).
In my experience, most devices that typical travelers carry are generally dual-voltage now, which greatly reduces the problem as a practical issue when traveling, though it is always important to check.