There are actually two theories to this. The first one starts to make sense when you look at manual typewriters. If someone typed too fast, the keys would jam. QWERTY placed common alphabets at a distance from each other and slowed typists down.
Another theory is that telegraph operators designed the QWERTY layout because it was easier (and faster) to decipher Morse code.
Either way, there was no reason to keep using the layout, but it stuck and there was resistance to change. You can actually change your keyboard layout to the faster Dvorak layout in the language settings (or just buy a new Dvorak keyboard).