The move was praised by Islamists but assailed by rights activists, lawyers and newspapers.
Police last month raided a hotel in the coastal city of Agadir, famed for its sandy beaches and lively nightlife, and arrested the women with 28 Saudi and nine Kuwaiti holidaymakers. Seven of the hotel's employees were also arrested.
The authorities later deported the holidaymakers without charging them, while they accused the 67 arrested Moroccans of debauchery and encouraging sex tourism.
In a verdict late on Tuesday, an Agadir court sentenced 15 girls to four months in jail and 45 to two months, including eight who received suspended terms, defence lawyers said.
Five hotel employees got jail sentences of between two and three years, a sixth got two months and another was acquitted. The court also ordered the closure of the hotel.
An Islamist faction within the main opposition Justice and Development party (PJD) called the action a right step to help preserve the Muslim country's moral and religious values.
"If the goal of this swoop is to fight sex tourism, then authorities ought to look at all hotels in Agadir, not just one, apply the law on all, not only on Moroccans, and fight factors that help prostitution flourish"
Abd al-Rahman Yazidi,
The PJD recently called on the authorities to crack down on what it says is growing sex tourism in the country, a popular destination mainly for tourists from Europe and the Arab Gulf.
But human rights activists called the trial a scandal, criticising the authorities for letting the tourists go free.
"The women involved are victims of society," said Abdelhamid Amine, head of the country's main human rights group AMDH.
"If the goal of this swoop is to fight sex tourism, then authorities ought to look at all hotels in Agadir, not just one, apply the law on all, not only on Moroccans, and fight factors that help prostitution flourish," said Abd al-Rahman Yazidi, head of local rights group Anaruz.