Daniel Moser, 54, was arrested in the German business capital Frankfurt in April on spying charges after he compiled information on officials tasked by Germany's North Rhine-Westphalia state with uncovering wealth hidden at Swiss banks.
In a plea bargain, Moser admitted to the espionage operation and named his Swiss spy handlers.
The former police officer denied acting with criminal intent and said he was driven by “patriotism, love for adventure, profit-seeking motives and indignation”.
Taking his confession into account, the court gave Moser a suspended sentence of one year and ten months and fined him 25,000 euros ($29,000) — a lighter penalty than the two year suspended sentence and 40,000 euro fine sought by prosecutors.
Moser had told the court he was paid 28,000 euros between 2011 and 2013 for the spying job.
Switzerland had been seeking the identities of three German tax officers, hoping to build a case against them for illegally obtaining banking data which are protected under the country's strict secrecy laws.
Swiss banks have come under intense pressure in recent years as several German states started buying CDs or USB memory sticks allegedly containing data on German taxpayers who had parked their fortunes across the border.
Fearing prosecution, many of Germany's rich and famous subsequently came forward to declare their hidden wealth, boosting the tax coffers of Europe's biggest economy by billions of euros.
In an extraordinary court statement in October, Moser, who once worked as a security officer at Swiss banking giant UBS, voiced regret for his action.
He described himself as a “middleman” between the Swiss secret service and a security company — which apparently helped to compile information on the targeted individuals.
The spying case had sparked outrage in Germany, with foreign minister Sigmar Gabriel rebuking Switzerland over the scandal and summoning Bern's envoy for clarification.
It was especially embarrassing for Switzerland, which in 2015 had signed a deal with the European Union to exchange bank data starting in 2018 as part of an international pledge to clamp down on tax cheats.