Both are right and both are wrong.
- Spanish aviation law states that it is permitted for under 14's to fly just using their Libretto de Famila as ID when flying with a parent who produced their own required Photo ID. However, I understand that this is just for domestic flights.
- The Ryanair issue you are referring to was for a domestic flight, but Ryanair claimed that A) They were not a Spanish Carrier and therefore observed Irish law, which stated that a Passport or other photo ID was required, and that B) It advised the passengers of this when they confirmed and understood the T's & C's.
Basically, European aviation lets each country set their own requirements (for domestic flights), so as far as I can see in this particular case it's 50 / 50 thing. The judge ruled that Ryanair had to abide by Spanish law, but even so, even if you are flying domestically I wouldn't risk the hassle and would take a passport for your child if you have one.