A standard Islamic law reference text says a female ruler is not permitted. Why? Because of statements from Muhammad

For example, this statement in Sahih al-Bukhari, the most canonical hadith collection:

Volume 9, Book 88, Number 219:
Narrated Abu Bakra:
During the battle of Al-Jamal, Allah benefited me with a Word (I heard from the Prophet). When the Prophet heard the news that the people of Persia had made the daughter of Khosrau their Queen (ruler), he said, "Never will succeed such a nation as makes a woman their ruler."
For Islamic law's prohibition of female rulers, see page 641 of The Reliance of the Traveller/Umdat Al-Salik, a standard Islamic legal reference certified by Al-Azhar, the chief center of Islamic and Arabic learning in the world.