I think it's because when bikes were first developed, people noticed that you sit astride them, a lot like riding a horse. Later they saw that in a car, you sit in a chair--more like driving a carriage or wagon.
This is just a guess. And I don't know why "driving" changed from it's earlier meaning of herding a group of animals, like a cattle drive or driving a flock of geese. Or even swatting at mosquitoes to drive them away.