Spain spent €289,394,768.35 ($394,346,674.56) on border protection from 2007 to 2013.
During the same period, however, it spent just €9,342,834.50 ($12,731,100) on programmes to benefit refugees and asylum seekers.
These are the figures cited in a new Amnesty International report on immigration into the EU.
The difference between the Spanish two figures was also the largest in the EU, Amnesty International said in its report titled The human cost of Fortress Europe: Human rights violations against migrants and refugees at Europe’s borders.
Europe-wide, the spend was nearly €2 billion on border protection and €700 million on improving the situation for would-be immigrants.
"The effectiveness of EU measures to stem the flow of irregular migrants and refugees is, at best, questionable. Meanwhile, the cost in human lives and misery is incalculable and is being paid by some of the world’s most vulnerable people,” said John Dalhuisen, Europe and Central Asia Programme Director at Amnesty International.
In June, the EU told Spain — the only EU country with land borders with Africa — it would receive €10 million ($13.6 million) from the European Union to fight illegal immigration in its two north African territories of Ceuta and Melilla.
The money would come from the EU's emergency fund and it would be used on "some of the 26 projects proposed by Spain to face the situation in Ceuta and Melilla", the EU said in a statement.
Part of the funds will be used to strengthen border fences, fund voluntary return programmes for migrants who manage to enter the two territories illegally and make improvements to government-run migrant reception centres.
In late May, about 500 African migrants leapt a towering, triple-layer border fence to cross from Morocco into Melilla.
A reception centre in Melilla is built to house 480 immigrants but now houses over 2,000 people.
Aside from trying to storm the border fence around Melilla, would-be immigrants also try to sail or swim to Melilla and Ceuta which sit on the Mediterranean opposite mainland Spain.
On February 6th about 15 migrants drowned in Moroccan waters while trying to swim to Ceuta from a nearby beach.
Spain's interior minister on March 4th estimated there were 40,000 migrants waiting to cross from Morocco into Ceuta and Melilla.
Another 40,000 were waiting to enter Morocco from Mauritania en route to the two cities, he added.
The Amnesty International report also comes a day after another human rights group called for the closure of Spain's refugee internment camps.
"We want international observers in Melilla, because of a constant and daily violation of human rights," said Christian Orgaz of the State Campaign for the Closure of Internment camps (CIE).
The group said both Spanish and Moroccan authorities were responsible for these violations which included police violence, a lack of healthcare provision for migrants and the "absolute abondomment" of migrants under the age of 18 in the city of Melilla.