Read James Brooks‘ answer to What is the origin of the word ugliness? on Quora
The word ugliness was first recorded in the late 14th century. It comes from the word ugly and the suffix -ness. Ugly appeared in the mid 13th century from an Old Norse word uggligr (“dreadful, fearful”), which itself is from uggr (“fear, apprehension, dread” (perhaps related to agg “strife, hate”)) + –ligr (“-like”).
Ugly is actually an unusual word when compared with other languages because it was formed from the root “fear/dread” rather than the root “ill-shaped”, which is more common among Indo-European words.
[1] Origin and meaning of ugly by Online Etymology Dictionary