Dear Student,
Musharraf became the President of Pakistan in order to legitimize his authority. After the military coup, Musharraf was the de facto leader of Pakistan but not the de jure leader. To enhance his legitimacy as the ruler of Pakistan, he must have felt necessary to become the de jure leader which was possible by becoming the President.
Regards.