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.
The above answer is descriptive, but not responsive. Actually, the name originated from the coronation of Otto the Great by Pope John XII as "Holy Roman Emperor" in the year 962. Otto had inherited the kingdom of Saxony from his father, and had worked to end the feudal divisions which marked Germany at the time. He is considered to be the first true king of all of Germany. His greatest achievement, however, was the defeat of the Magyars at the Battle of Lechfeld in 955, which forever ended Hungarian attempts to invade Western Europe, and also secured the Pope's position in Italy and the Papal States. Otto's coronation by Pope John is considered by historians to mark the birth of the Holy Roman Empire.
Earlier, on Christmas Day, 800 A.D., Charlemagne had been crowned "Emperor of the Romans" by Pope Leo III for Charlemagne's help in restoring Leo to power. The obvious reference, of course was that Charlemagne was the heir to the now defunct Western Roman Empire. Otto's coronation in 962 added the word "Holy" to the title, and thus the Empire was born. It survived until its destruction by Napoleon when he invaded the German states.