Migrants in Spain have queued up to apply for the country's mass legalisation programme on Monday.