DHL are entirely correct.
In additiion, it is not their fault (or their problem). This is all standard stuff when sending/receiving anything from outside the EU. You refer to "DHL Customs", it is not DHL Customs, but Spanish Customs. DHL are simply acting as broker on your behalf.
You need to send them the invioice for the 'phone showing that IVA/VAT was paid. It would help if this clearly has the phone serial number on it. Otherwise, they (Spanish customs) will charge it again, plus other duties and costs. The item should have been clearly declared as a "re-import". There are special procedures for this, and it is the shipper's responsibiity (not DHL's) to ensure that the correct paperwork is provided.
DHL are correct. Spanish Customs are correct. These are the procedures. The fact that you did not research them, or know them is not their problem, it's yours. DHL are actually helping you with customs here. It could be worse - you could be dealing with them direct.