The Foreign and Commonwealth Office (FCO) said it could "undermine the bilateral relationship between the UK and Spain" if confidential details were made public.
The SNP last night accused the FCO of "briefing against Scotland on the international stage".
A spokesman said: "People in Scotland have a right to know what Westminster is saying behind our backs."
The Prime Minister has insisted the referendum is a matter for Scots alone - the reason he gives for refusing to debate Salmond on TV.
However, his government has briefed numerous foreign governments, including the 28 EU states, Russia, the US, Australia and Canada about the vote while promoting a pro-union view.
Last week, the Sunday Herald revealed that LibDem Scottish Secretary Alistair Carmichael and Tory Europe Minister David Lidington briefed the London diplomatic corps - the ambassadors and consul generals from foreign nations - about the referendum in January.
Four days later, at Holyrood's European and External Affairs Committee, Carmichael abruptly cut off an aide who offered to tell MSPs more about the FCO's work.
Scotland Office official Chris Flatt told the committee he had briefed "dozens" of foreign diplomats.
Asked by an SNP MSP if he could supply details, Flatt replied: "Absolutely, yes."
Carmichael then cut in: "Well, I don't know that that's really something for us to give an answer to."
The FCO has now refused to release details of its talks with the Spanish government since January.
It was asked under freedom of information law to supply records of all official or ministerial level meetings with Spain in which the Scottish referendum was discussed.
Alex Salmond has previously accused Cameron and Spanish Prime Minister Manuel Rajoy, who fears Catalan independence, of "plotting" against a Yes vote.
The FCO said it held information about discussions between UK and Spanish government officials, but it was "not in the public interest" to release the material.
"We assess that the release of information from these discussions would be likely to prejudice relations between the UK and Spain," it said.
"The UK Government has drawn the attention of foreign governments interested in the process and implications of the referendum to the Scotland analysis programme [a dozen reports]. This seeks to inform the debate about Scotland's future by providing facts and analysis about Scotland's place in the UK, and how it contributes to and benefits from being part of the UK."
The UK Government said it was perfectly reasonable for it to discuss its views on the union and independence with other governments, and that the Scottish Government did likewise.
SNP Culture and External Affairs Secretary Fiona Hyslop met representatives of the Russian government in Edinburgh last week, despite the crisis in Crimea.
A UK Government spokesman said: "Another week, another made-up story. It is ridiculous to accuse the UK Government of doing anything but making its policy on independence clear when it speaks to foreign governments.
"That is exactly what Scottish Government ministers do when they go abroad. This is simply an exercise in double standards."