Gibraltar is not the United Kingdom. It is an autonomous state. It agreed to become part of the EEC in 1982, by agreement between it, Spain and the UK, an agreement which expressly states that this does not change either Spain's or the UK's attitude to the territory. Gibraltans did not have the right to vote in European elections until 2004, when it was added to the south west constituency after a European Court case forced the UK to allow it. Spain objected to this happening.
Other British dependencies such as the Isle of Man and the Channel Islands are not part of the EEC.
Other Spanish, Portuguese, French and Dutch dependencies, such as the Azores, the Canary Islands and Saint Martin/Sint Maarten, are similarly only part of the EEC by agreement, and the customs union doesn't apply to most of them, which is why you can get duty free fags in Lanzarote.
Spain are quite right to point out that Gibraltar is a separate jurisdiction to the UK and that any agreement with the UK might not necessarily apply to Gibraltar.
Howard's comments about going to war with Spain were, quite frankly, ludicrous.