Answer
Primo de Rivera wanted to withdraw the military from Africa because he believed that Spain was overstretched and that the country could not afford to continue fighting in the colonial wars. He also believed that the military was becoming too powerful and that it was necessary to reduce its size and influence.