Yahya related to me from Malik that Abu'r-Rijal Muhammad ibn Abd ar-Rahman heard his mother Amra bint Abd ar-Rahman say, "The Messenger of Allah, may Allah bless him and grant him peace, cursed both men and women who dug up," meaning those who dug up graves.
Furthermore, this hadith also teaches us to be mindful of our words as cursing someone or something can have serious consequences both in this world and the hereafter. We must always strive to use kind words when speaking about others or situations even if we disagree with them or find them unpleasant.