The Verdict: Not eligible
Spain's armed forces only accept foreign nationals from a set list of countries, and yours is not on it. Look at Spain's ordinary residence routes instead.
The list, set by regulation, covers countries with special historical, cultural and linguistic ties to Spain: in practice most of Latin America and Equatorial Guinea. There is no discretion for anyone outside it. If you hold a second nationality that is on the list, take the quiz again with that one.
Spain's ordinary routes are open at any age: the digital nomad visa for remote workers, skilled work with a Spanish employer, or the non-lucrative visa if you live on savings or passive income. Naturalisation then takes ten years of legal residence for most people.
A Spanish parent or grandparent, or Sephardic ancestry, can shorten that a great deal; the descent and religious return quizzes test both.