Not countries, and not illegal _but_ :-) I personally know that Barcelona an Dublin have introduced laws that make it more difficult to have more apartments hit the market (Licences with heavy penalties)
(typing this from an AirBnB apartment run by a licensed host in Barcelona)
https://www.bbc.com/news/uk-scotland-edinburgh-east-fife-427...