Yes, it is allowed to move vehicles of the category A1(!) in Spain if your license which allows you to drive B is at least 3 years old.
Quotation from Wikipedia:
B licence holders in Czech Republic (only motorcycles with automatic transmission), Italy, Latvia, Malta (after a training of 10 hours), Slovakia (after two years and only motorcycles with automatic transmission), Spain (after three years), Poland (after three years), Portugal (at least 25 years old or additional licence for mopeds), and Belgium (only with a Belgian Driving Licence, after two years) are allowed to drive motorcycles not exceeding 125 cubic centimetres (7.6 cu in) within the respective countries. In Austria (after five years, training of 6 hours), France (after two years, a training of 7 hours), Luxembourg (after two years, training of 7 hours), and the United Kingdom (Compulsory Basic Training), a practical training without exam is needed for B licence holders.
German source: http://motorrad.wikia.com/wiki/Ausland
Wer den Führerschein Klasse B mindestens 3 Jahre hat, darf automatisch auch 125er fahren. Das gilt auch für Ausländer. Translation: Who has an EU license which is at least 3 years old, is allowed to drive 125ccm motorcycles. This also applies to foreigners.