The court found the man guilty on Friday of issuing four tickets to municipal tow trucks for supposedly jumping red lights between October 2010 and February 2011.
According to Catalan daily El Periodico, the court statement declared that the fines were issued as "retaliation" after his own car was hit with a fine.
The policeman, an officer in the city's Guardia Urbana, issued the tickets "knowing" the red lights had never been run.
In one case, the tow truck had not yet left the depot at the time of the alleged infraction.
Other vehicles were fined while still in the garage or while they were elsewhere in streets across the city.
The man was found guilty of falsifying a official documents and of abusing his office as a policeman – for which he received the custodial sentence – despite a full confession and the mitigating circumstance of mental illness.
The court judged that the man acted in a "confused manner, with a greatly affected capacity to both reason and act" because of depression caused by relationship problems and for which he required medical help, according to statements by psychologists and psychiatrists.