The short answer to this is yes, it's absolutely fine to travel during Ramadan. The timing of Ramadan is in relation to the moon, so the date changes year on year, but currently falls in August/September, moving slowly backwards each year. The month of Ramadan is the biggest event on the Moroccan calendar, during which Muslims fast during the daytime and feast at night. However Ramadan hardly affects visitors. Some restaurants are closed for lunch and things generally slow down.
No restrictions apply to non–Muslims but it is respectful to refrain from eating, drinking or smoking in public during the fast. The country tends to be less busy with visitors and some hotels reduce their rates so it can be an excellent time to travel.
At the end of the month is the holiday of Eid al-Fitr, when practically everything closes for around three days. Ramadan is August 11-September 9th 2010 and August 1st to August 30th 2011.