Whether this is correct or not depends on the quality of that tax. If you owe the tax and the hotel collects it for the tax authority (like the German Kurtaxe) then you need to pay. If the hotel owes the tax (like the German VAT) then the hotel will have to pay it.