The phrase "in the sight" refers to Yahweh seeing Er's wickedness. Alternate translation: "was wicked and Yahweh saw it" (See: [[rc://en/ta/man/translate/figs-idiom]])
Yahweh killed him because he was wicked. This can be made clear. Alternate translation: "So Yahweh killed him" (See: [[rc://en/ta/man/translate/figs-explicit]])