In Italy, there is a legal requirement that all guests of hotelhotels, B&Bs, rooms, etc. (including Airbnb) must be registered with the local police, so I guess it's not a matter of tourist tax but they are asking it because of this registration.
In the most recent version of the law, the host must fill in an online form to register the guests. From what I read (I don't have a hotel/airbnb myself, so maybe others with first-hand knowledge can confirm), the host must provide name, surname, gender, birth date and place, nationality of all occupants, but document details are required only for one of the guests (the "group leader").
This registration must happen before the guests can enter their room (although in my experience this part is not always respected).
Reference (in Italian): https://www.laleggepertutti.it/283994_cosa-registra-lhotel
So, from what I understand, they don't need IDs for all occupants, but they need some personal information. Probably they are asking for IDs just for their convenience: it's easier for them to read all the required information from a document, rather than asking about them and dealing with all the language issues and "how do you spell it?".