Quarterbacks use slides to avoid injury. Since football is known for tackles and quarterbacks are an essential factor to any team, quarterbacks take extra precautions to avoid tackles and any situation that could cause injuries. So instead of risking getting tackled, quarterbacks perform a safe and controlled slide to end the play.
Some people are concerned that sliding is just as dangerous as a tackle, as the quarterback could injure his knees during a slide. Also, a hard, dry field may get caught in the quarterback's cleats when he tries to slide. However, despite these situations, quarterbacks opt for this risk rather than being tackled. There's more chance of injury from being tackled head on rather than on the ground.
Why do quarterbacks slide more often than other positions? Because quarterbacks are so essential and harder to replace than a halfback or wide receiver. Any extra precautions that can be taken for the quarterback should be taken.