The incident on Friday is the latest flare-up between Britain and Spain over the British-held territory in recent months.
A Foreign office spokesman said: "As far as we are concerned there is no justification for this infringement of the UK's rights under the Vienna Convention," a 1961 protocol agreement that protects diplomatic communications.
"Official correspondence and diplomatic bags are inviolable," the spokesman added.
Britain responded with a formal diplomatic note of protest on Monday, less than a week after it summoned the Spanish ambassador in London following an incursion into Gibraltar's territorial waters by a Spanish state research vessel.
"The British embassy in Madrid has formally protested to the Spanish Ministry of Foreign Affairs via note verbale and we await an urgent explanation," a Foreign Office spokesman said.
"We will consider further action in light of that explanation."
The Spanish foreign ministry said it had no official comment to make, but a diplomatic source told AFP: "According to the Convention of Vienna (on diplomatic relations), the item was not a diplomatic bag, because it did not fulfil the requirements" to be considered as such.
The source, who asked not to be named, declined to elaborate.
The Foreign Office spokesman said Britain had asked Spanish authorities to investigate what occurred "and take action to ensure it does not happen again".
"There are long-established and internationally-accepted articles concerning official correspondence and the diplomatic bag to which the Foreign Office adheres," the spokesman said.
"We expect other parties to the (Vienna) Convention, including EU and NATO allies, to do the same."