If you are spending a short amount of time in Morocco making the trek out to the Sahara for some camel riding may not be feasible. The Sahara is actually 10+ hours away from Marrakesh and the shortest group tour I would do is the popular 3 day 2 night tour. (see more my Sahara tour here)
You are in luck though because you can take a camel ride right outside of Marrakesh! The problem is many people book these tours expecting sand dunes and endless desert when that is not the case. A camel ride in Marrakesh will be a bit different than the normal pictures you see all over the internet.
First off the climate of Marrakesh is subtropical desert. There are actually huge forests and the Atlas mountains right out side of Marrakesh, which means no big sand dunes any where near you. You actually will be riding the camels in glorified empty lots on the outskirts of Marrakesh. This is not a bad thing! It is actually still a pretty amazing experience to be on a camel with a (very) friendly guide as the sun goes down.
For the actual booking of the tour I suggest waiting till you get to Marrakesh to book with either your hostel or hotel. There are dozens of tour companies who offer hour long sunset camel tours in the lots outside of Marrakesh every single day. I booked my hour long camel ride at my hostel and paid $25. That included pick up and drop off at my hostel and the camel ride.
The ride itself was very relaxing, and enjoyable. Completely worth the $25 we paid. When you arrive they give you fun clothes to wear and wrap your head with a traditional head wrap. The camels are very calm gentle creatures and the guides are extremely friendly and knowledgeable. They will lead you on an hour long walk while the sun goes down. Go into the tour with an open mind and you should have an amazing time.