Why do we dedicate graves for people that have died?
The body is a sacred entity. In the first place, it is formed in the very image of the Great God, who is the creator and sustainer of the universe, who is the Father of our spirits, who is the sustainer of all life, who condescends to extend his love and mercy to those who love Him and keep his commandments and who, through the great atoning sacrifice of his beloved Son, has provided the means whereby we may return to live with Him for eternity, conditioned on our repentance and compliance with gospel principles.
Secondly, the body is the temple of the Holy Spirit, who may dwell within us, revealing to us the will of God, and acting as a guide and protector in our lives, depending on our faith and righteousness.
In the third place, the body is the tabernacle of our own individual spirits that have come from the presence of God to experience the mortal probation.
As a sacred entity, the body should be treated with great respect, both in life and in death. During our lives we should keep the body clean and free from the contamination of evil. When the spirit leaves the body to return to its heavenly home, the mortal remains are then laid to rest in anticipation of the time that they will be brought forth again in the glorious resurrection to be reunited with the spirit in an eternal state, to live forever in that environment that is merited by the type of life lived during mortality.
Elder Bruce R. McConkie has stated the proper procedure of the disposition of the body at the time of death:
It is the accepted practice of the Church–based on precedent and guided by the spirit of revelation in those whom God has chosen to lead the Church to dedicate the graves of faithful saints who depart this life. Dedication of graves is an ordinance of the gospel and is performed in the name of Christ and in the authority of the Melchizedek priesthood. The dedicatory prayer should contain such expressions of thanksgiving, such words of comfort to the bereaved, such assurances (or petitions) for the protecting care of Divine providence over the grave as the Spirit may indicate to the one performing the dedication. (Bruce R. McConkie, Mormon Doctrine, p.188)