the problem is a bit in the framing of your question: "Why was korea able to remove kanji but japan wasn't when both languages use homophones?". i see two problems with this.
firstly, all human language have homophones to a greater or lesser degree. it is true that Chinese and especially Japanese are somewhat internationally renowned for having big numbers of homophones (there's a humorous short story about two neighbors running into each other in the street and having an extended chat about nougaku, not realizing that while the one is talking about 農学 (agriculture), the other is talking about 能楽 (No theater)).
secondly, your question is biased in favor of abolition of kanji, making it look like it was the natural and desirable way for any language that has been using kanji to replace that writing system with a more sound-based one; that may or may not be true, but this partisan stance begs the question whether the Japanese and the Koreans have ever collectively wanted to stop using kanji.
i guess the somewhat baffling answer to this question is that for a long time in their histories, neither the Japanese nor the Koreans have wanted to abolish kanji / hanja. as for the Japanese, while the well-known kanji usage regulations stipulated after WWII did limit the number of kanji, they are still used in great numbers. one often sees obscure kanji and kanji with obscure readings. every japanese can at almost any given point in time opt to switch to using kana in place of kanji, and in fact this sometimes happens (like my former landlady who posted a sign containing '石っけん' rather than '石鹸', as she deemed the former to make for an easier read for her foreign student residents). the fact that many japanese continue to write many kanji clearly shows they're not willing to abolish this system.
likewise, the Koreans have for the 500 years between Sejong's invention of hangeul and their widespread, nation-wide and almost exclusive adoption resisted the urge to 'rid' themselves of kanji. it is only in the 20th century that hangeul rose from being an auxiliary script that many literati looked down on to the primary means of written expression that we see today.
rephrasing your question, i think we should better ask: why did the Koreans stop using kanji, and the Japanese didn't?, plain and simple, and i think the answer lies to a big part in: a matter of preference and choice. homophones have relatively little to do with that; as has been pointed out, when you do have a 'phonetic' script at your hand, and you can state yourself unambiguously in speaking, then the same should hold when writing with that phonetic script, homophones or not.
i'm also afraid i can't quite follow @lzmtky's argumentation with those vowelcounts and whatnot. firstly, reading 'どうぶつゆらいかんせんしょう' i do have every difficulty with that string as you, but that is really caused by reading habits, not by the fact that that string is not in principle very readable.
further, there are rather more than 400 syllable blocks in Korean—Unicode defines 11,172 precomposed hangeul syllables (not all of which are in frequent use). your number for Japanese 'sounds' is also slightly misleading: there are 45 (not 46) kana with distinct sounds, but: there are an additional 25 kana with (han-) dakuten, of which 2 have to be subtracted because they're phonetic duplicates; further, there are the youon digraphs (a la しゅ), of which there are 27 with distinct sounds. that leaves us with 45 + 23 + 27 = 95. but what have we counted here? well, that's about the number of different morae in Japanese, not what is commonly assumed the basic building block in segmental phonetics—that would be the number of distinct vowels and consonants.
to compare an alleged number of 400 hangeul syllable blocks with an alleged number 46 distinct kana is pretty unjustified; it is comparing two writing systems at best anyhow, not two sound systems. for that to do, you must obviously (at least) count vowels, consonants, and their possible combinations. if your intention was to present syllable counts (and thought, reasonably, that the amount of distinct, common hangeul blocks will just about equal the number of distinct Korean syllables), well then you'd have to take into account that a Japanese syllable may have more than one mora: おおさか has four morae, but only three syllables; likewise, かわい has three morae, but only two syllables. i think we can safely say that Japanese has more in the vicinity of 200 distinct syllables.
commenting on your statement that "even in Korean, there are different ways of writing a word/name which sounds the same. For example, 민아 and 미나, 윤아 and 유나, 각오 and 가고. Therefore, this variety eliminates the need for kanji in Korean", let me ask: are you saying that because there's more than one way to spell a given Korean word, therefore it is not necessary ('eliminates the need') to use kanji? that's, like, because there's two ways to reach my bank from my house, therefore i don't have to ride the bicycle? i don't get that logic.