This is true, but in practice admission in most Ph.D. programs in Spain is not very selective as there are more slots than applicants, so any master's degree will do, even if it's not research-oriented. And for foreign students, many Ph.D. programs have a rule that "if you can prove that your degree gives access to Ph.D. programs in your own country, then you can enter" so it's even possible to be admitted with e.g. a US bachelor's degree (YMMV per university though).