How compound words "eighteen" and "roommate" are built

Solution 1:

Eighteen is not formed out of 'eight' and 'teen'; it's a number 'eighteen' in its own right. Etymologically, it once was a compound, though, of 'eight' and 'ten'. Old English did have both 't''s: eahtatene, but the two t's had merged by Middle English.

Roommate, on the other hand, is a word from Modern English and is indeed a compound word 'room' + 'mate'.

So the real answer to your question "why are they different?" is "because eighteen is a much older word".