Okay, this isn't always possible. You might be on a narrow one-lane road and the sides may be the only place you have to drive. There might be a long line of cars in the middle lane already, forcing you to the stay to the left or the right. But here's the theory:
Roads are constructed so that they're highest in the middle. The difference may be slight, but it causes water to run off the center hump (actually, it's called a crown) and drain toward the edges. If you're driving in the rain you want to avoid standing water, which means that you want to be where the water isn't -- and that's in the center of the road. No, the center won't be dry either, especially if it's still raining, but it's going to be the driest place around that isn't in somebody's garage.