Why an adjective is used instead of an adverb here?
It would have a different meaning, as you say.
Unconscious is a complement, without which the verb spend is incomplete.
Unconsciously would say nothing about how they were during that time, just how they were doing whatever it was they were doing. (It only makes sense with a different meaning of unconscious: unthinking, automatic, unpurposeful).
They rest sixteen to eighteen hours a day and spend most of that unconscious.
"Unconscious" is a predicative adjunct: predicative because it refers to a predicand, i.e. "they", and an adjunct because it's integrated into clause structure and hence a modifier..
In other words, the predicative/non-predicative contrast cuts across that between complement and adjunct.
Since the predicative denotes a property that is ascribed to "they", it must be the adjective "unconscious", not the adverb "unconsciously".