There is actually a reason why hotels charge for that tax separately and they want cash for it. This was (and still is) object of debate in Italian newspapers.
The legislator introduced this tax to finance costs associated with tourism (mainly art restoration and tourism facilities), however the law was not clear and hotel operators have interpreted this way to avoid problems with it.
First let's analyze why hotels bill separately for it. Basically, as the law is written, if included in your hotel invoice (which is a form a copy of which goes to the Italian tax authorities) it would subject the hotel to the payment of VAT (a sort of sales tax) on that amount. So if for example the hotel collects 5 euro for that tax from you, (if included in the bill) the hotel would need to pay the government another 1 euro in VAT (21%), since the entire amount in the bill is subject to the VAT. The tax in our example would then become 5 euro tourist tax for you+ 1 euro VAT for the hotel=6 euro. But that was not the intention since the tourism tax should not be subject to VAT.
Second let's analyze why hotels want cash (not credit card for it). The reason in this case is because if they let you pay the 5 euro tourist tax with a credit card, the hotel would need to pay a 4% commission to the credit card company for an amount that is not hotel revenue, but rather a tax that the hotel will need to fully give back to the government. Of course 4% of 5 euro is not much but if you multiply times many days for each hotel room it would be quite a commission fee for the hotel to pay for an amount that does not represent a revenue or income to the hotel.
So lacking better instructions in the law, hotels charge separately in cash to avoid paying VAT and/or credit card commission fees on that tourism tax.