What is the main purpose of a rabbi officiating at a funeral service?
Much like a wedding, the purpose of a rabbi at a funeral is to ensure that everything is done according to halachah (likewise, a rabbi at a wedding does not form the bond of marriage between the couple, but ensures that the bond is properly formed according to halachah). For example, the rabbi will ensure that the burial is performed according to tradition, that the prayer for the soul of the departed and kaddish are recited at the proper times, and that the ceremony of consoling the mourners is properly carried out. There are other issues and questions that can come up, and in order to avoid doubts and confusion, it is important to have a rabbi at hand. The rabbi will often eulogize the departed, which is a matter of halachah as well as respect for the departed.