In some places we, Spaniards, are asked for our National ID Cards to rent the audioguides. It is just to ensure that you will return the electronic gadget back. The clerks ask for your passports in the same situation, considering that it is the equivalent document, but actually isn't (if they loose or damage it by mistake, you would be in serious trouble).

I would suggest that, next time it happens to you, say that you don't carry your passport with you, but offer some other ID Card you have (Work badge, drivers' license,...). I am sure they will accept.