The Holy Roman Empire got its name through the ambitions of its leaders and the fact that both the Roman Catholic Church and the secular government wanted to increase their power and prestige. We should note that the name “Holy Roman Empire” is not really used consistently until the 1200s, centuries after the empire itself was founded.
The “Roman” part of the name came from the desire of the rulers of the empire to connect themselves to the Roman Empire. The Roman Empire had, of course, been the only empire to consolidate control of most of Europe. Since it was so widespread and so powerful, later powers wanted to associate themselves with it. They wanted to claim that they were the successors to the Roman Empire.
The “Holy” part of the name comes from the fact that both Church and secular state wanted to enhance their power and prestige. In those days, the Roman Catholic Church was the only Christian Church in the West. It held great power because of this. Political leaders wanted its blessing so that they could claim that God supported them. At the same time, the Church needed support from the secular state. Therefore, popes were eager to have a role in crowning and legitimizing emperors. Because both sides needed each other to some degree, the empire was called “Holy” and emperors were officially crowned by the pope, signifying God’s approval of their authority.