Abu Hurayrah reported that the Prophet (peace and blessings of Allaah be upon him) said: "If any of you were to sit on a live coal and let it burn his clothes until it reached his skin, this would be better for him than sitting on a grave." (Reported by Muslim, 2/667). As for stepping on graves, many people do this, and when a person is buried you can see people who do not care where they walk (even wearing shoes sometimes) on neighbouring graves, with no respect for the dead. The seriousness of this matter is clear from the words of the Prophet (peace and blessings of Allaah be upon him): "If I were to walk on coals or on a sword, or to mend my shoe with my own foot, this would be better for me than walking on the grave of a Muslim." (Reported by Ibn Maajah, 1/499; see also Saheeh al-Jaami', 5038). So what about those who take over the site of a graveyard and build businesses or homes there? As for responding to the call of nature in a graveyard, this is something done by people who have no morals at all. When they feel the need, they jump over the wall of the graveyard and offend the dead with their unpleasant odours and impure waste matter. The Prophet (peace and blessings of Allaah be upon him) said: "'I wouldn't care if it were in the middle of the graveyard or in the middle of the marketplace" (ibid.) - i.e. answering the call of nature in a graveyard is like uncovering one's 'awrah and answering the call of nature in front of people in a marketplace. Those who deliberately throw their trash into graveyards (especially those which are abandoned and whose walls are broken down) are included in this condemnation. Among the etiquette required of those who visit graveyards is taking off their shoes when they want to walk between graves.
One of the beauties of Islam is that it teaches everything that will improve and reform mankind, including how to remove impurities by cleaning oneself properly after urinating or defecating. But some people are very careless about this matter, and allow their clothes and bodies to become contaminated, thus causing their prayers to be invalidated. The Prophet (peace and blessings of Allaah be upon him) told us that this is one of the causes for the punishment in the grave. Ibn 'Abbaas said: "The Prophet (peace and blessings of Allaah be upon him) passed by one of the gardens of Madeenah, and heard the sound of two men being punished in their graves. The Prophet (peace and blessings of Allaah be upon him) said: "They are being punished, but they are not being punished for any major sin. One of them used not to clean himself properly after urinating, and the other used to spread malicious gossip." (Reported by al-Bukhaari; see Fath al-Baari, 1/317). Indeed, the Prophet (peace and blessings of Allaah be upon him) said that "most of the punishment of the grave will be because of urine." (Reported by Imaam Ahmad, 2/326; see also Saheeh al-Jaami', 1213). Not cleaning oneself properly after urinating also includes undue haste in completing the action, or deliberately urinating in a position or place where the urine can come back on oneself, or failing to clean oneself afterwards, or not cleaning oneself properly. Modern imitation of the kuffaar has reached such an extent that some rest rooms for men contain wall-mounted urinals which are open to view, so a person who uses them is urinating in full view of anyone who comes and goes with no shame, in the midst of impurity. Thus he combines two abhorrent and forbidden acts in one deed: not hiding his private parts from the view of others, and nor cleaning himself properly after urinating.