The six were also accused of violating state security, possession of explosives and other charges, the official MAP news agency reported.
The court on Monday handed the death penalty to Mohcine Bouaarfa and Taoufik Hanouichi, who were accused of being the top members of a radical cell affiliated to Salafist Jihad.
The court sentenced 31 other cell members to jail terms of one to 20 years. Nine others were freed.
Authorities hold Salafist Jihad responsible for attacks that killed 45 people, including 12 bombers, in Casablanca in May 2003.
The cell was dismantled in January 2004 after raids by police forces in the ancient cities of Fes and Meknes.
Authorities accused the two of killing a Jewish merchant in Casablanca and several others, including an Interior Ministry official and a police officer.
Hanouichi, Bouaarfa and several of the accused admitted they committed the killings.
Moroccan authorities rarely carry out death penalties. The last execution was in 1994 of a senior police officer convicted of serial rape.