35 kilometres away from Merzouga, Rissani is one of the large cities in South Morocco. You can visit old alawite settlements, called ksar, and the Mausoleum of Moulay Ismail, founder of the dynasty. It has a very lively market (souk), and so large you might need half a day to go through all shops !
Rissani is a large oasis, and its palm grove is a huge green island in the middle of the desert, though diminished by former years' drought.
If Erfoud can be only a stop on the road to Merzouga, Errachidia is worth a longer halt, and espcially the blue source of Meski (but not during high season or weekends).