Most halakhic discussions on the topic start with the Rambam in MT Melachim 1:5 (quoted above in comments)
We may not appoint a woman as king. When describing the monarchy, the
Torah employs the male form of the word king and not the female.
This principle also applies to all other positions of authority within
Israel. Only men should be ...