I am a US citizen traveling from New York to Ghana. I have a 16 hour layover in Morocco and want to make sure that if I leave the airport I will be allowed to go back through customs to board my last flight.
Usually the problem isn't getting back out of the country, but getting in (there are exceptions to this, such as countries where exit visas are required).
According to the Consulate General of the Kingdom of Morocco in New York, citizens of the USA do not need a visa to visit Morocco for a stay up to 90 days. This would allow you to leave the airport during your stopover. Be sure to allow sufficient time to return to the airport before your next flight!