Every region of the country has its own legislation. It could be that some regions don't have special licence for hostels. But, for example, we are opening now hostel in Barcelona city, and here is a very strict legislation for hostels with a lot of requirements. So no wonder, that many hostels here, even chains, opt to work illegally (for example, to operate as pensions).
To make sure that everything is ok with the property and its licence, you should go to municipality of the city, where the hostel is located, and get information about the issue (hostel in spanish is "albergue juvenil" or "albergue turístico"). However, the fact that the hostel has 80 beds instead of 40 allowed, clearly indicates that they are working illegally. And if it will be discovered, owners will have to pay a heavy fine and get rid of extra beds.