As I understand it, this happened because the technology for transmitting direct current was not good enough back in the days when the national power grid was being set up.
When power is used in a home, it must be at a relatively low voltage. But transmitting current at that low of a voltage is not efficient. What is usually done is to use transformers to take high voltage current (from the grid) and make it into low voltage current that can be used in homes.
In the old days, it was not possible to do this with DC -- only with AC. And that's why they used AC. It is becoming more feasible to transform DC nowadays so there are moves toward using DC more because it has some advantages.
There are several reasons for using AC current rather than DC current. To begin with the current generated for the national grid is basically in the form of AC. This current can also be converted in DC current, but because of the basic technological characteristics of generation technology, the current naturally produced by all kinds of generators is AC current.
Another major advantage of AC current is the ability to convert voltage of AC current using AC transformers. This enables current to be stepped up to very high voltages for long distance transmission, and stepping down the voltage in stages along the transmission network as the current reaches near the consumers, till the voltage is stepped down to the lowest voltage suitable for domestic and other retail application. This transmission of current at different voltages along different sections of the electrical network provides high level of transmission efficiency combined with flexibility with safety. Also it enables industrial consumers requiring higher voltage current to get the same easily.
AC current is also the most suitable type of current for most of the applications. In addition, AC current is safer as compared to DC current.