One way to hold this word: it is a line being drawn, with God on one side and this thing on the other. In religious writing the line is meant seriously — this person, this act, does not belong on God's side, and from there the word slides easily into plain 'wicked'. The complaining use can be thought of as the same line drawn for fun: four in the morning is put outside anything a reasonable world would allow. The heavy word does light work, and the gap between the weight and the subject is the joke.
From the word’s history
From Middle English ungodli: un- 'not' plus godli, which goes back to Old English godlīċ, god plus a suffix meaning 'having the character of'.
從中古英文 ungodli 來的,是 un-(不)加上 godli。godli 可以追到古英文的 godlīċ,也就是 god 加上表示「有…樣子」的字尾。所以這個字一開始就是「不像神的」,宗教的意思是它的起點。
Wiktionary entry for ungodly, etymology 1 (kaikki extract, source_ref kaikki:3f6f69a190036ae4:1077838029): "From Middle English ungodli ... from un- ... + godli ... derived from Old English godlīċ ... from god + -līċ."
登入就可以看每一支怎麼連回核心畫面。