The excerpt above reflects the idea that Tom's faith is being tested.
Focus on the part of the quote, " - that it was vain to serve God, that God had forgotten him." Tom is questioning his faith, saying that his God had forgotten him, that it was vain to serve his God, and referencing his soul bitter thoughts.
The answer I found with my brain is A good luck
Which is the most likely purpose of the dashes in "That I did always love"?Dashes encourage the readers to note individual words