The answer above doesn't quite get the sense of the poem. Basically, the speaker, who is not necessarily Hardy, is saying that the certainty of knowing that his suffering was directed by or the result of some god or force more powerful than he is would be preferable to being subject to blind chance, even if that god or superior force was vengeful and delighted in the speaker's misery.
The word "unmerited" in line six describes the speaker's anger, which he would realize was unmerited (i.e. pointless, without purpose) if such a god or force did make itself and its motives known to him. The knowledge or awareness that the speaker's suffering was caused by such a god or force would steel him (make him feel more resolute) and half put him at ease. Instead, the speaker is subject to the arbitrariness of chance, which would just as soon give him happiness as pain.
The "but not so" in the third stanza is not saying that there is no god or superior being. It's saying that the knowledge of such a god and the resoluteness and ease such knowledge would give the speaker is not to be, because such god or being never said the quoted language in the first stanza or made itself known to the speaker.
The first 8 lines of the poem show that if there were some all powerful vengeful god who took defeating love as a victory and gave him ecstasy, then the reader would find contentment in that he was suffering a fate unmerited. He would find solace in the fact that there was nothing he could do. He would take pride in himself and die an honorable death, because he knows that it is an undeserving one.
The final 6 lines; however, take a turn. The words, “But not so,” let the reader know that what is stated in the first two stanzas is not what the subject in the poem believes to be true. The poet asks ‘why does joy end?’ and ‘why does hope wither?’ The author then tells us that, “Crass Casualty. . . And dicing Time,” are the deciders in the world. “Crass Casualty,” means insensible chance, and, “. . . dicing Time,” means that the poet believes things do not happen for a reason, and actions that occur in the world just run their course randomly as if they were controlled by the random chance of rolling a die.
The author says that these two elements, which are capitalized symbolizing that the poet wants them to be seen as powerful deities in the poem, are pit against people. The poet says, “Crass Casualty obstructs the sun and rain.” Sun and rain here symbolize natural happiness and optimism that can be found in the world. He infers that chance or what the world makes you a casualty of will get in the way of natural beautiful things, thus making them difficult to appreciate. He says that, “. . . dicing Time,” inhibits the gladness that can be found in that sun and rain. The course of events that occur randomly throughout a person’s life will cause a person to take their eyes off of what could put happiness and optimism in their lives. Time wears a person out.
“These purblind Doomsters had as readily strown/ Blisses about my pilgrimage as pain.” Hardy combines, “Time,” and, “Casualty,” the two ‘gods’ in the poem into a category. A doomster is a person who reads off a judges sentence to a prisoner, or predicts disaster in the future. They are the bearer of the bad news. This pessimistic view of his gods show us that he expects to be dealt a bad hand in life and wallow in pity afterwards. Purblind means blind from birth. In conjunction with the adjectives, crass and dicing, this means the subject in the poem believes that his gods do not know or care about the outcome of their random actions. The subject in the poem states that the doomsters, casualty and time, have been as willing to throw happiness as pain into his life. The emphasis on the word, “pain,” as the last word of the poem lead us to believe the subject is not happy with his gods of time and casualty, but the rest of the poem indicates that he is aware that there is nothing that can be done when dealing with a god but to accept what they choose, whether that choice was made out of anger or by rolling the dice.
Thomas Hardy (1840-1928) wrote the sonnet "Hap" in the year 1898. The word 'hap' means 'that which happens by chance.' The poem reflects faithfully his pessimistic, fatalistic and atheistic philosophy of life.
In the first eight lines - the octave- Hardy asserts that he would die in righteous anger at his unmerited sufferings and pain, if only a sadistic and all powerful god would mock at him by gleefully saying that his undeserved suffering which has been willed by god is his ecstasy:
IF but some vengeful god would call to me
From up the sky, and laugh: "Thou suffering thing,
Know that thy sorrow is my ecstasy,
That thy love's loss is my hate's profiting!"
The volta or the 'turn' which indicates the complete non-existence a god is indicated at the beginning of the sestet (the next six lines) by "But not so." Hardy asserts that in his "pilgrimage" of life he has met with both sorrow and joy and that it is not god who is responsible for this but the "purblind doomsters" "Casualty" [chance, accident] and "Time." "Doomsters" are the court officers who announced the judgement to the accused prisoners in the magistrate's court.
Hardy's conclusion is that it is not god who determines the joy and sorrow in a person's life but "casualty" or chance which is completely neutral and dictates that all events in a person's life whether joyful or sorrowful take place indiscriminately at no fixed or expected time. "Dicing time" refers to the fact that events in a person's life take place unexpectedly and purely by chance like the throw of a dice.
Hardy foregrounds the importance of "Casualty" and "Time" and the insignificance of "god" by capitalizing 'casualty' and 'time' and not by capitalizing "god" which is the usual practice.