"Hap" is a sonnet in which the speaker laments the way that their life has turned out. The poem presents life as a game of chance—one which the speaker feels they've been losing, leading them to conclude that there is no god. True to the sonnet form, this borrows the language of logic/argument: if only x were true, then I could do y.
First, the poem imagines an angry "god" calling down from heaven, mocking the speaker. Note how "god" here isn't capitalized, indicating that the speaker doesn't really believe in the existence of the deity being discussed.
The speaker imagines their suffering making this god happy: "thy sorrow is my ecstasy." The antithesis between the speaker's "sorrow" and the god's "ecstasy" creates the impression of a logical system at work. While cruel and unfair, suffering, in this system, would at least have a purpose or explanation. Human beings would be the playthings of a higher power, placed in terrible situations as a kind of divine amusement.
The fourth line gets more specific: the speaker imagines a god taking special delight in the speaker's "loss" of love. This implies that the speaker has recently gone through a breakup (or, perhaps, that their beloved has died). The god's hate increases (metaphorically "profits") from the speaker losing what's most dear to them. This is a simple equation with a weirdly reassuring balance to it; the speaker wishes life were this straightforward.
Notice how the spitting, hissing quality of the sibilance in these lines makes this "vengeful God" seem extra bitter and hateful: "sky," "suffering," "sorrow," "ecstasy," "loss."
Note, too, that the poem is written in iambic pentameter. This is the typical meter of sonnets, in which each line consists of five iambs (poetic feet with a da-DUM rhythm). Here's that meter at work in the first line:
If but | some venge- | ful god | would call | to me
These iambs steadily plod along, subtly evoking the speaker's state of weary resignation. But there's an important variation in line 3, which begins with a trochee (the opposite of an iamb): "Know that." That stress on the word "Know" emphasizes the god's command to the speaker to know their place in the world.