Swiss authorities want Herve Falciani, a French-Italian citizen arrested in Barcelona in July 2012 and then granted conditional release, sent back to Switzerland to face charges of breaching banking secrecy.
But during his extradition hearing Spanish prosecutor Dolores Delgado opposed the request on the grounds that the former computer engineer at the banking giant was helping authorities investigate tax fraud.
"Falciani has cooperated with the authorities of various countries, starting with France, then Italy, the United States, and now Spain is benefiting from this cooperation," she told the Madrid court hearing the case.
"We can't punish people who, when they observe criminal conduct where they work, denounce it to the authorities," she said, adding that the total fraud unveiled amounted to €200 billion ($260 billion).
Falciani told the court he had received no remuneration for providing the data to France and other governments.
"Never, in no instance," the whistleblower said when asked if he had received any money for turning over the files -- data linked to at least 24,000 customers of the bank's Swiss subsidiary -- to the French authorities.
The files, which were subsequently relayed by French investigators to their counterparts in the United States, Spain, Italy and several other European Union countries, led to a raft of prosecutions.
He told the court he obtained the files from colleagues and said the information was so abundant that "if printed, it would fill an entire freight train."
Falciani said he informed Swiss authorities in 2008 but they refused to let him make an anonymous complaint. He said he then sent the files to French authorities.