A 1,000-dirham fine ($120) imposed on both journalists from Al Watan Alaan will remain in place, the court ruled.
"It's a surprise. I expected an acquittal for my clients, or even a lenient sentence," said Abdelfettah Ouadghiri, a lawyer for the two men, who were not present in the court when the decision was announced.
The verdict was also condemned by Moroccan press groups.
The journalists were originally sentenced on August 15, although Hurmatallah was granted provisional release from jail on September 11.
He will remain free until further appeals are exhausted, said Ouadghiri, who has eight days to file an appeal.
Although Morocco's press is widely seen as the freest in the Arab world, the authorities warn that media workers should not consider themselves to be above the law.
"There are no chances of Islamic groups winning as most people in Morocco are enjoying its liberal culture"
Nazia, Lahore, Pakistan
Send us your views
Freedom House, a non-governmental think-tank based in the US, said in a 2006 survey that "legal harassment" of journalists had increased.
Criticism of Islam, the king and the royal family or publishing anything that challenges Morocco's "territorial integrity," which is an indirect reference to the Western Sahara, can result in heavy fines and lengthy prison sentences.
In a recent interview, Khadija Riyadi, president of the Moroccan Human Rights Association, told Al Jazeera: "Freedom of the press is going through a real crisis in Morocco."
She said: The independent press in particular is the main target in this kind of intimidation.
"Moroccan courts are used as a mechanism to clamp down on the press and mete out severe punishment to journalists who are known for their courage in breaking taboos".
'State of alert'
The Al Watan Alaan case resulted from an article entitled "Secret reports behind the state of alert in Morocco" published in the weekly's July 14 edition.
In a separate case related to the issue of press freedom in the country, the publisher of two Moroccan weeklies has been charged with showing disrespect to the monarchy.
The Paris-based Reporters Without Borders watchdog and the national Moroccan press union SNPM have condemned the action against Nichane and Tel Quel weeklies.