The Spanish crew probably thought it was a UK sub and not a US sub.
Also, “HMS Sabre”??? I don’t think the USN puts names on anything that small. The Royal Navy must be pretty hard up when they’re putting names on glorified fishing boats.
It's a matter of legalities. The HMS designation means it is a warship under the United Nations Convention on the Law of the Sea which means it can be used to enforce British claims on Gibraltar. Using larger ships for this purpose is pointless - and would also be potentially provocative towards the Spanish (it's no accident that the Guardia Civil patrol boat is of similar tonnage - while it is important to both countries that they maintain their claims, Spain and the UK do not want to wind up accidentally in conflict, so an arms race is to be avoided).
HMS Sabre was originally MV Grey Wolf when it was in a role that didn't require that legal status.