Slamming slippers on the ground in Masjid Nabawi
Any work should be done with proper restraint and calmness. Haste and rashness are not suitable for a refined temperament. The Holy Prophet (Sallallahu alaihi wa sallam) did every work with calmness and grace. See a sentence from a lengthy Hadith of Sahih Muslim:
Translation: Ummul Momineen Hadhrat Aisha Siddiqua (May Allah be well pleased with her) says: The Holy Prophet (Sallallahu alaihi wa sallam) softly took His cloak, calmly wore His sandals, opened the door softly, stepped outside and softly closed the door. (Sahih Muslim, Vol. 1, Pg No: 313, Hadith No: 974)
Slamming the slippers on the ground and putting them down in such a way that they make noise is not preferred anywhere. In Masjid, this act is all the more denounced. While entering the Masjid and leaving them, the etiquette of the Masjid should be kept in mind. Nothing should be done which disturbs the people offering Salaat or those busy in Dhikr or recitation of the Holy Quran. Thus, while removing slippers or wearing them, we should do it softly.
These are the rules for any Masjid. The rules for Masjid Nabawi and the Haram are stricter than that of other Masjid. Thus, while wearing/removing slippers, one should keep in mind the sanctity of these places.