The court also jailed two men convicted of attacking the couple, while outside two topless Femen activists from France were detained and deported after protesting for Rabat to decriminalise homosexuality.
Residents of the town of Beni Mellal in central Morocco, meanwhile, gathered to demand the release of the jailed attackers.
The trial centred on an alleged assault of two homosexual men by a group of individuals in an apartment in Beni Mellal last month.
A video of the alleged attack appeared on YouTube, showing two half naked men with bloodied faces being attacked and dragged into the street.
A first victim was sentenced to four months in jail for "acts against nature", but an appeal hearing decided Monday to release him on time served.
The other victim was handed a four-month suspended sentence for "sexual deviancy".
For the attack on the couple, one defendant was handed a six-month prison sentence and another received four months for forced entry, resorting to violence and carrying weapons.
Two others were acquitted and a fifth was to be tried later in a minors' court.
Rights organisations have demanded that Morocco decriminalise homosexuality, which is punishable by up to three years in jail.
Last August, a court in Rabat sentenced two men to four months in prison for beating up a presumed homosexual because of his appearance.
The men were arrested after websites posted a video of the victim trying in vain to take shelter in a taxi to escape a crowd.
And in another incident in a string of controversies over homosexuality, two men were jailed for four months in June for kissing in public in the capital.