One who watches over the deceased, even though it is not his dead relative, is exempt from the recitation of Shema, from the Amida prayer and from phylacteries, and from all mitzvot mentioned in the Torah.
One who transports bones from place to place may not place them in a saddlebag and place them on the donkey’s back and ride on them, as in doing so he treats the remains disgracefully. However, if he is afraid of gentiles or highwaymen and therefore must move quickly, he is permitted to do so.
One who sees the deceased taken to burial and does not escort him has committed a transgression due to the verse: “He who mocks the poor blasphemes his Creator.”
Similarly, the Gemara relates:
Rabbi Ḥiyya and Rabbi Yonatan were walking in a cemetery and the sky-blue string of Rabbi Yonatan’s ritual fringes was cast to the ground and dragging across the graves. Rabbi Ḥiyya said to him: Lift it, so the dead will not say: Tomorrow, when their day comes, they will come to be buried with us, and now they are insulting us.
According to the ruling in theYoreh Shulhan Aruk (YorehDe’ah 23:1), in places where the custom is to attach ritual fringes to one’s regular clothing, one may enter a cemetery with that garment, but he must make certain that the ritual fringes do not drag over the graves, in accordance with the opinion of Rabbi Ḥiyya. Nowadays, when the garment with the ritual fringes is designated exclusively for prayer, one is prohibited from wearing it in a cemetery even if the ritual fringes do not drag across the graves. If one wears the garment beneath his clothing, it is permitted to enter the cemetery.