The dimples are there to increase drag, albeit only slightly. But they increase something called "Magnus lift". The Magnus effect is the commonly observed effect in which a spinning ball curves away from its original flight path. A golf ball always has some kind of spin on it after it has been hit, whether it is backspin, topspin, or either direction of sidespin to hook or slice the ball.
The ball below has backspin, Magnus force is acting as a lifting force from below the ball. Airflow is deflected in the direction of the spin, which is why the spin continues the whole time the ball is in flight.