The situation you describe is hardly acceptable from a business (responsibility of the hotel) but also a legal perspective. And it as nothing to do with flirting.
After having validated the story with the manager, you should have complained to the police immediately.
Spain is a beautiful country, but unfortunately it is also one of the countries in Europe where violence on women is the most important. Your case would have been taken very seriously by the police (and could have prevented other similar stories).
Sexual harassment in Spain