Yes. Under Italian law, hotels and Airbnb hosts must collect guests' passport details so the authorities can track arrivals for security reasons. Have your photo ID ready.
Note: If a host never asks for your passport details, be more cautious, as they may not be registered with the authorities.