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)
It’s not all black and white, though. Limited supply pushes up the prices (and AirBnB’s earnings are a percentage of the total spend), licensing requirements remove a few unknowns, decrease the potential of the host running some kind of bait-and-switch scam and make a rental appear more legitimate from the guest’s point of view.
(typing this from an AirBnB apartment run by a licensed host in Barcelona)