What was the purpose of the name since they were neither Roman nor holy(considering many emperors pissed off the Pope)?
Listen to the recent podcast by /u/ThucydidesWasAwesome with Peter Wilson, where he explains this: https://www.reddit.com/r/AskHistorians/comments/6wgzvy/askhistorians_podcast_093_the_holy_roman_empire/
In the episode, one can almost feel Wilson's shoulders drop as he is forced to yet again explain (for probably the 10,000th time in his life) why Voltaire's quote is inaccurate and misrepresents medieval and early modern thinking.
The tl;dr (or tl;dl) is:
Holy- yeah, sort of, kinda
Roman- definitely a stretch, but some reasons for it
Empire- yes, but not in the sense of a 19th century colonial empire
Also, the HRE was rarely referred to as such in its day. It was usually simply "the Empire".
There's an excellent answer by /u/kieslowskifan on the state of the Holy Roman Empire at the time when Voltaire made the infamous quote that you allude to in your question.