The court decision on Tuesday left the country split over whether Jose Miguel Arenas Beltran -- better known as Valtonyc -- was exercising his right to free expression, or whether his lyrics were harmful enough to warrant prison.
Supreme Court judges upheld Valtonyc's sentence, saying: "It is enough to read the facts (of the case) to understand the gravity of the expressions used, and appreciate their criminal nature."
Among the lyrics deemed criminal by the court were lines like: "Let them be as frightened as a police officer in the Basque Country" and "the king has a rendez-vous at the village square, with a noose around his neck".
The reference to the Basque Country hinted at violence by ETA, the separatist group that for decades staged scores of attacks across Spain that left hundreds of officials and civilians dead.
Several people have faced charges and jail terms in Spain in recent years because of song lyrics and tweets, particularly over glorifying terrorism.
Leftwing figures have branded the prosecutions an attack on freedom of expression. But terror victim groups do not want to see violence trivialised.
Censurar un libro porque habla de corrupción, enviar a un rapero a la cárcel por una canción o retirar una obra de arte porque incomoda. Las mordazas del PP son incompatibles con un país democrático y justo.— Irene Montero (@Irene_Montero_) February 21, 2018
"Censuring a book because it speaks of corruption, sending a rapper to jail for a song, or taking down a work of art because it's uncomfortable. The gag laws of the PP are incompatible with a fair and democratic country, " tweeted hard-left party Podemos's deputy Irene Montero.
Writers' association Pen International also condemned the court's decision.
"Freedom of expression can be restricted only in limited circumstances and under strict conditions, which we believe were not met in this case," the group said in a statement.