The relations between the Church and the Empire were complicated. The Church was effectively a power structure in competition with the nobility (while also existing in symbiosis with them), while the Pope and Emperor competed for influence in the Empire.
In a completely inaccurate and not very helpful analogy, it would be a bit like a political party appointing a prominent member of their main rivals to run the country - the Republicans having Hillary run as their presidential candidate, the Tories electing Corbyn as PM etc.