The final consonant in Korean words is used to differentiate the pronunciation and meaning. If you don't have the second 받침 'ㄱ' in '맑음 (lucidity, clearness)', you can't differentiate it from '말음 (a final sound)' which has a completely different meaning and pronunciation.
It is like 'p' in English. If you add 'p' in 'super', the pronunciation of the vowel 'u' and meaning do change. Actually the 'p' in 'supper' acts like 받침 in Korean. There are more examples where 'p' is used to change the vowel sound as in 'consumption'. 받침 is one of the most difficult parts in learning Korean, but there are some rules of thumb that can help you get more familiarized with it.
Most of the time, it is wrong if you write it as it sounds.
Actually, it was a tip given by one of my elementary school teachers and I have remembered it since.
The more important thing to note is in Korean, endings, particles, and markers with initial 'o' consonant don't change their forms. Examples are
-이다 (움직이다, 먹이다), -은 (먹은), -에 (미국에), -으세요 (먹으세요), -어서 (먹어서), -으니 (먹으니), -으니까 (먹으니까), etc.
If you write the words above as they sound, they will be all wrong. 움지기다, 머기다, 머근, 미구게, 머그세요, 머거서, 머그니, 머그니까.
You can put it another way:
If you write any Korean word with a sound of a final consonant (받침) in the middle of a
word and it is connected with any ending/particle/marker, etc. starting with 'o', you need to be suspicious and check one more time whether you spelled it right or wrong.
Well, it is easier said than done. However, if you keep practicing this when you write Korean words, chances of your misspelling them will be certainly reduced.
소리 나는 대로 적으면 틀리기 쉽다. It is likely to be wrong if you write a word as it sounds.
It also applies to other nouns, adjectives, and adverbs, etc. For example,
맑음 (말금 X), 먹이 (머기 X), 점잖다 (점잔타 X), 많다 (만타 X), 적음 (저금 X), etc.
There are some exceptions when you have to write a word as it sounds. That makes learning Korean complicated. But if you get familiarized with stems of a word, it won't be that confusing.