The convictions, the latest in a series of trials of suspected hardline Islamists, came after the men were found guilty of either fomenting trouble or having links with the outlawed group Salafia Jihadia.
Two of the men were given 15-year sentences while seven others received 10-year terms. The remaining were ordered to serve out two-to-six year terms.
The convicted men were among the 100 people being prosecuted after the bomb attacks in Casablanca in May.
The five simultaneous blasts at different locations in downtown Casablanca had left 45 people dead.
Moroccan investigators say the attacks were organised by Salafia Jihadia, which mainly recruits among poor residents of city suburbs.
The investigators however have not ruled out participation of international groups in the coordinated attacks.
A Moroccan court few days ago handed down a life sentence to a Frenchman for plotting such attacks.