In 1675, the King Charles XI of Sweden appointed him as court chaplain. During the wars in the following years, he followed the King, and became a close confidant of his. He kept a diary during the whole time, which has proven to be valuable as research material.
In 1680 he wed Queen Ulrika Eleonora and the King. He spent the following five years mainly on the island of Gotland as a superintendent over the Diocese of Visby. He managed to write the Rudera Gothlandica during this time (published first 1901).
In 1685 he was appointed Bishop of Linköping in eastern Sweden. In 1693 he was transferred to the seat in Diocese of Skara, central Sweden, where he remained until 1711. On the death of the Archbishop of Uppsala, Spegel was elected his successor, although he only held this position for three years.
During that time he wrote an influential epos called God's work and rest about God's creation as written about in the Bible.
It is said that he worked for education of the people, and wanted every peasant in Sweden to be able to read.
He was also known as a hymnist and poet.
- (Swedish)Svenskt Litteraturhistoria i Sammandrag (1904)
- (Swedish)article Spegel, Haqvin In Nordisk familjebok (1917)