Spain has opened an investigation into Airbnb for failing to delete thousands of rental offers from its platform in an attempt to curb a business blamed by authorities and many residents for contributing to housing shortages and soaring real estate prices.